The Analytics settings page lets you add PostHog analytics to your documentation site. Page views are tracked client-side and proxied through your own domain for privacy - no data is sent directly to PostHog.
Use the Enable Analytics toggle to turn tracking on or off. When disabled, no tracking code is added to your site.
Your project API key from PostHog (starts with phc_). This is a public identifier and is safe to commit to your repository.
To find your key:
Select the PostHog cloud region that matches your project:
us.i.posthog.comeu.i.posthog.comAnalytics settings are stored in analytics.json at the root of your repository. Here's an example:
{
"provider": "posthog",
"posthog": {
"key": "phc_your_project_api_key",
"host": "https://us.i.posthog.com"
}
}When enabled, Doccupine routes all analytics traffic through your documentation domain using Next.js rewrites. Instead of sending data directly to PostHog (which ad blockers may intercept), requests go through /ingest on your own domain and are proxied to PostHog.
Changes to analytics settings are staged as pending changes. Click Publish to commit them to your repository and trigger a deploy.
See the Analytics page for the full configuration reference and additional details on the privacy proxy.