Integrations

Mintlify

Add Databuddy's privacy-first analytics to your Mintlify documentation site by dropping a small databuddy.js file next to your docs.json. Mintlify auto-loads any .js file in your content directory on every page, so the tracker becomes available across all of your docs with zero per-page wiring.

How to Add Databuddy to Mintlify

1

Get Your Client ID

Open your Databuddy dashboard, select the website that represents your docs, and copy the Client ID from the tracking setup screen.

2

Create databuddy.js

In your Mintlify project, create a new file named databuddy.js in the same directory as your docs.json.

databuddy.jsjavascript
(() => {
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);
})();

Replace YOUR_CLIENT_ID with the Client ID you copied from your dashboard.

3

Deploy Your Docs

Commit and push the new file to your repository:

bash
git add databuddy.js
git commit -m "feat(docs): add databuddy analytics"
git push

Mintlify rebuilds your docs on push and includes any .js file in your content directory on every page automatically. No extra changes to docs.json are required.

4

Verify Tracking

Open your published Mintlify site, then:

  1. Open your browser's DevTools and switch to the Network tab.
  2. Reload the page and confirm a request to cdn.databuddy.cc/databuddy.js returns 200.
  3. Visit your Databuddy dashboard and watch real-time visitors appear.

Configuration Options

Enable extra tracking features by adding more data-* attributes when you create the script element.

databuddy.jsjavascript
(() => {
const script = document.createElement("script");
script.src = "https://cdn.databuddy.cc/databuddy.js";
script.setAttribute("data-client-id", "YOUR_CLIENT_ID");
script.setAttribute("data-track-attributes", "true");
script.setAttribute("data-track-outgoing-links", "true");
script.setAttribute("data-track-interactions", "true");
script.setAttribute("data-track-performance", "true");
script.setAttribute("data-track-web-vitals", "true");
script.setAttribute("data-track-errors", "true");
script.crossOrigin = "anonymous";
script.async = true;
document.head.appendChild(script);
})();

See the full list of options in the SDK reference.

Custom Event Tracking

Mintlify renders MDX, so you can drop tracked elements directly into any .mdx page.

Using Data Attributes

html
<button data-track="cta_click" data-button-type="primary">
Get Started
</button>

<a href="/pricing" data-track="pricing_link_click" data-link-location="docs-header">
View Pricing
</a>

Programmatic Events

Once the script has loaded, window.databuddy is available globally. You can call it from any inline <script> block in an MDX page or from your own custom script.

javascript
if (window.databuddy) {
window.databuddy.track("docs_search", {
  query: "getting started",
  page_path: window.location.pathname,
});
}

Troubleshooting

Need help with your Mintlify integration? Contact us at help@databuddy.cc.

How is this guide?