How to add the script to your Docusaurus site

There are several simple ways to integrate Plausible Analytics with your Docusaurus documentation site. Let's take a look at them:

Option 1. Inject the script through the docusaurus.config.js#

Add this Plausible Analytics snippet into your "docusaurus.config.js" file (make sure to change "" to the domain name that you added to your Plausible account).

This is how we've integrated Plausible into our very own Docusaurus-powered documentation:

module.exports = {
scripts: [{src: '', async: true, defer: true, 'data-domain': ''}],

Option 2: Plausible Analytics community plugin#

Now you can go to your website and verify whether Plausible Analytics script has been added and to your Plausible Analytics account to see whether the stats are being tracked. See here how to verify the integration.