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 "yourdomain.com" 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:
Option 2: Plausible Analytics community plugin
- "A Docusaurus plugin for Plausible Analytics". Built and maintained by Alistair Scott and the Abar Team.
Now you can go to your website to verify if the Plausible Analytics script has been added and to your Plausible Analytics account to see whether the stats are being tracked.