Skip to content

Add Plausible analytics to docs - #123

Merged
Kaysahni merged 1 commit into
mainfrom
add-plausible-analytics
Oct 15, 2026
Merged

Kaysahni merged 1 commit into
mainfrom
add-plausible-analytics

Conversation

@Kaysahni

Copy link
Copy Markdown
Collaborator

What this adds

A new root-level plausible.js. Mintlify loads root .js files on every page, the same way it loads amplitude.js and hubspot.js.

What it does

  • Loads the same Plausible script that flox.dev already uses, so /docs pageviews show up in the flox.dev Plausible site.
  • Only runs on production hosts (flox.dev, www.flox.dev). Mintlify preview deployments aren't counted.
  • Loads without waiting for cookie consent, for the same reason as the website: Plausible is cookie-less, and putting it behind the HubSpot consent gate would miss the visitors we want to count.
  • Skips loading if #plausible-script is already on the page, and wraps everything in a try/catch so it can't break the docs.

Checks

  • node --check plausible.js: passes.
  • mint broken-links (via the repo's Flox environment): 3 broken /changelog/rss.xml links and an AGENTS.md parse warning. Both are already on main and have nothing to do with this change.
  • mint validate: fails on the same AGENTS.md parse warning, with identical output on main.

How to verify after deploy

  1. Open https://flox.dev/docs and check that the page has a <script id="plausible-script"> tag loading from plausible.io.
  2. In the flox.dev Plausible dashboard, confirm pageviews start showing up for /docs/... paths.
  3. On a Mintlify preview URL, confirm the script tag is not present.

Local browser test

Ran the docs dev server in headless Chrome with requests to flox.dev served locally, the real Plausible script loaded from plausible.io, and outgoing Plausible events captured locally (nothing sent to Plausible). No cookie banner interaction.

  • Script tag injected and real Plausible script loaded on flox.dev
  • Pageview sent on first load, and again on client-side navigation (/ → /man/flox)
  • Nothing loads on a non-production host (localhost)

🤖 Generated with Claude Code

Load the same cookie-less Plausible script as flox.dev so /docs
pageviews land in the flox.dev Plausible site.

It only runs on the production hosts (flox.dev, www.flox.dev), so
Mintlify previews aren't counted.

It loads outside the HubSpot consent gate. Plausible sets no cookies,
and gating it behind consent would miss the visitors we want to count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mintlify

mintlify Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
flox 🟢 Ready View Preview Oct 14, 2026, 8:12 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@Kaysahni
Kaysahni added this pull request to the merge queue Oct 15, 2026
Merged via the queue into main with commit 9eda456 Oct 15, 2026
4 checks passed
@Kaysahni
Kaysahni deleted the add-plausible-analytics branch October 15, 2026 14:37

This branch was successfully deployed

1 active deployment
staging — fcb7be3a Deployed Oct 14, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants