scripts array in docusaurus.config.js. Docusaurus injects it into every page, and client-side navigation between docs pages is tracked automatically.
Before you start
- A tinyanalytics site. If you don’t have one yet, follow the Quickstart.
- Your site’s numeric site ID, from Settings → Tracking in your dashboard.
Add the script in docusaurus.config.js
Add an entry to the top-level scripts array:
docusaurus.config.js
Client-side navigation is tracked automatically
Docusaurus is a single-page app that renders navigation on the client, and tinyanalytics records each page change as a new pageview by default (data-track-spa). See Track single-page apps to change this.
Verify
Build or deploy your site, open it in a browser, then check Realtime in your dashboard for your visit. See Verify your setup for the full check.Your install is working when your own visit appears in Realtime in your dashboard.
Related
Install on VitePress
Another docs framework.
Configure the tracking script
Every
data-* option you can set.Track custom events
Measure clicks and downloads.
Verify your setup
Confirm tracking works.