mirror of
https://github.com/mintlify/docs.git
synced 2026-09-14 13:35:46 +08:00
693dbc361f
* Fix Vale style warnings across docs from past week of merges Generated-By: mintlify-agent * Apply suggestion from @ethanpalm * Apply suggestion from @ethanpalm * Apply suggestion from @ethanpalm * Apply suggestion from @ethanpalm * Apply suggestion from @ethanpalm * Apply suggestions from code review Co-authored-by: Ethan Palm <56270045+ethanpalm@users.noreply.github.com> --------- Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> Co-authored-by: Ethan Palm <56270045+ethanpalm@users.noreply.github.com>
62 lines
1.9 KiB
Plaintext
62 lines
1.9 KiB
Plaintext
---
|
|
title: "PostHog"
|
|
description: "Integrate PostHog with your Mintlify documentation site to track product analytics, feature usage, and user behavior with your API key."
|
|
keywords: ["PostHog integration", "product analytics", "feature flags", "self-hosted PostHog"]
|
|
boost: 3
|
|
---
|
|
|
|
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.
|
|
|
|
<CodeGroup>
|
|
|
|
```json Analytics options in docs.json
|
|
"integrations": {
|
|
"posthog": {
|
|
"apiKey": "YOUR_POSTHOG_PROJECT_API_KEY",
|
|
"apiHost": "optional",
|
|
"sessionRecording": true
|
|
}
|
|
}
|
|
```
|
|
|
|
```json Example
|
|
"integrations": {
|
|
"posthog": {
|
|
"apiKey": "phc_TXdpocbYTeZVm5VJmMzHTMrCofBQu3e0kN7HGMNGTVW"
|
|
}
|
|
}
|
|
```
|
|
|
|
</CodeGroup>
|
|
|
|
### Configuration options
|
|
|
|
<ParamField path="apiKey" type="string" required>
|
|
Your PostHog project API key. Must start with `phc_`.
|
|
</ParamField>
|
|
|
|
<ParamField path="apiHost" type="string">
|
|
The URL of your PostHog instance. Only required if you are self-hosting PostHog. Defaults to `https://app.posthog.com`.
|
|
</ParamField>
|
|
|
|
<ParamField path="sessionRecording" type="boolean" default="true">
|
|
Enable or disable session recording. Set to `false` to disable session recordings while keeping analytics enabled.
|
|
</ParamField>
|
|
|
|
## Session recordings
|
|
|
|
Configuring PostHog enables session recordings by default. To disable session recordings while keeping analytics enabled, set `sessionRecording` to `false` in your configuration.
|
|
|
|
```json 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.
|