Skip to main content
Add the following to your docs.json file to send analytics to PostHog. You only need to include apiHost if you are self-hosting PostHog. We send events to https://app.posthog.com by default.
"integrations": {
    "posthog": {
        "apiKey": "YOUR_POSTHOG_PROJECT_API_KEY",
        "apiHost": "optional",
        "sessionRecording": true
    }
}

Configuration options

apiKey
string
required
Your PostHog project API key. Must start with phc_.
apiHost
string
The URL of your PostHog instance. Only required if you are self-hosting PostHog. Defaults to https://app.posthog.com.
sessionRecording
boolean
default:"true"
Enable or disable session recording. Set to false to disable session recordings while keeping analytics enabled.

Enabling PostHog analytics will disable the analytics on the Mintlify dashboard.

Session recordings

Session recordings are enabled by default when you configure PostHog. To disable session recordings while keeping analytics enabled, set sessionRecording to false in your configuration.
Disable session recordings
"integrations": {
    "posthog": {
        "apiKey": "phc_your-key",
        "sessionRecording": false
    }
}
You need to add the URL for your docs website to PostHog’s “Authorized domains for recordings” before you can receive session recordings. The option to add your URL is in PostHog’s project settings.