Analytics for Docs
docs.nhost.io has sent nothing to PostHog since 3 May 2026. Between October 2025 and January 2026 the docs recorded 10–17k page views per month from 1.7–3k unique readers. We now have no data on the docs at all.
There is no analytics snippet on the live site: on both /getting-started and /reference, window.analytics, window.posthog and window.gtag are undefined and the only scripts loaded are the three Astro bundles.
Why: the old docs ran on Mintlify (confirmed on a Nov 2025 snapshot — the site was served from mintlify-assets/) and the docs.* events came from its built-in Segment integration rather than from our own code. The Segment schema still lists 26 of them, including docs.footer.powered_by_mintlify_click. Astro/Starlight has no equivalent, so the tracking has to be written.
What to do: load Analytics.js on the docs site against the existing nhost_dashboard Segment source and emit the docs.* events again, keeping the names already in the schema. Nothing needs configuring on the Segment side — the PostHog destination forwards events by name, which is how these reached PostHog before.
Acceptance criteria
- Pageview on every docs page
-
anonymousIdshared acrossdocs.nhost.io,nhost.ioandapp.nhost.io(cookie domain.nhost.io) so docs → signup is traceable - Events: search query, search result click, code block copy, page feedback
-
docs.*names kept so new data lines up with the pre-Feb-2026 history
Source: nhost/nhost