RudderStack supports sending events to PostHog via the following connection modes:
Connection Mode | Web | Mobile | Server |
---|---|---|---|
Device Mode | Supported | - | - |
Cloud Mode | Supported | Supported | Supported |
https://app.posthog.com
domain or your instance URL. Based on your website's content security policy, you might need to allowlist the required domain to load the PostHog SDK successfully.Once you have confirmed that the source platform supports sending events to PostHog, follow these steps:
- From your RudderStack dashboard, add the source. Then, from the list of destinations, select PostHog.
- Assign a name to your destination and click Continue.
Connection settings
To successfully configure PostHog as a destination, you will need to configure the following settings:
- Team API Key: Enter your PostHog team API key. This is a mandatory field. For more information on obtaining your PostHog Team API Key, refer to the FAQ section below.
- Instance URL: Enter your PostHog instance URL.
https://[your-instance].com
.- Client-side Events Filtering: This setting lets you specify which events should be blocked or allowed to flow through to PostHog. For more information on this setting, refer to the Client-side Events Filtering guide.
- Use updated mapping for Group calls: Enable this setting to send the
group
traits as event properties to PostHog. It is strongly recommended to enable this setting to send all yourgroup
events to PostHog correctly.
Web device mode settings
This section lists some of the other configurable settings when sending events to PostHog via the web device mode.
- Use device mode to send events: If enabled, RudderStack will send the events to PostHog via the device mode.
- Enable Local Storage for Persistence: Enable this option to reduce the amount of data stored in the cookies by storing it locally instead.
- Enable autocapture with PostHog: Enable this option to allow PostHog to send auto-captured events.
- Allow PostHog to automatically capture pageview events: Enable this setting to allow the PostHog web SDK to send a page view event every time it is loaded on a page.
- Disable session recording: Enable this setting to stop PostHog from recording the user sessions. For more information on PostHog's session recording feature, refer to the PostHog documentation.
- Additional headers to pass with XHR requests to PostHog API: Add a list of key-value pairs in this field. The RudderStack web SDK will then forward these headers on the event requests sent to PostHog.
- Property denylist - Add a list of traits or event properties that you want the PostHog SDK to filter.
FAQ
Where can I find the PostHog Team API Key?
To get your PostHog Project API Key or Team API Key, follow the steps below:
- Login to your PostHog dashboard.
- Go to the Settings tab under the Project section in the left sidebar.
- You can find the Team API key under Project API Key or Team API Key.
Contact us
For more information on the topics covered on this page, email us or start a conversation in our Slack community.