Mintlify
Add one file to your Mintlify project and every docs page records visits in Databuddy.
Add the script
Create databuddy.js next to docs.json
(() => {
const script = document.createElement("script");
script.src = "https://cdn.databuddy.cc/databuddy.js";
script.setAttribute("data-client-id", "YOUR_CLIENT_ID");
script.crossOrigin = "anonymous";
script.async = true;
document.head.appendChild(script);
})();Your Client ID is in the Databuddy dashboard under your website's Settings → General.
Push it
git add databuddy.js
git commit -m "docs: add Databuddy analytics"
git pushMintlify includes every .js file in your content folder on every page, so docs.json needs no change.
Check it works
Open your published docs, not the local preview. In the Network tab, cdn.databuddy.cc/databuddy.js returns 200, and your visit appears on the dashboard.
If nothing arrives, check that your website's domain in Databuddy matches your published docs domain.
Track clicks in your pages
Add script.setAttribute("data-track-attributes", "true"); to databuddy.js, then name elements in any .mdx page:
<a href="/pricing" data-track="pricing_link_click" data-location="docs-header">View pricing</a>Turn on more tracking
Add a line to databuddy.js for each option:
script.setAttribute("data-track-outgoing-links", "true");
script.setAttribute("data-track-web-vitals", "true");
script.setAttribute("data-track-errors", "true");Related
How is this guide?