PostHog
Track product analytics events on your documentation site with PostHog.
PostHog captures product analytics events so you can understand how readers interact with your documentation. Enable the integration to send page views and events to your PostHog project.
Prerequisites
-
A PostHog account with a project created
-
Your PostHog project API key (starts with
phc_) -
Publishing access to your documentation project
Configure from the Editor
Open Site Config
In the Editor, click Site Config in the top toolbar.
Navigate to Integrations
Select Integrations from the left sidebar.
Enable PostHog
Select PostHog and enter your project API key. Optionally update the API host if you use a self-hosted or EU instance.
Publish
Click Publish to deploy the integration to your live site.
Configure via documentation.json
Add the posthog key under integrations in your documentation.json:
{
"integrations": {
"posthog": {
"apiKey": "phc_your_project_key",
"apiHost": "https://us.i.posthog.com"
}
}
}
| Property | Type | Required | Description |
|---|---|---|---|
apiKey | string | Yes | Your PostHog project API key (starts with phc_) |
apiHost | string | No | Your PostHog instance URL (defaults to https://us.i.posthog.com) |
Where to find your API key
-
Sign in to PostHog.
-
Go to Project Settings → Project API Key.
-
Copy the API key (format:
phc_...).
If you use PostHog Cloud EU, set apiHost to https://eu.i.posthog.com. For self-hosted instances, use your own PostHog domain.
What's next
-
Analytics and Chat Integrations — overview of all supported integrations
-
Mixpanel — event tracking with Mixpanel
-
Analytics overview — view traffic and engagement data for your documentation
Last updated 1 day ago
Built with Documentation.AI