PostHog

updated 1 year ago

In this article:

The Engage PostHog integration processes and sends user data and events identified and tracked through PostHog to Engage. You can then use the data for customer segmentation, targeted campaigns, and automation.

Setup

  1. Visit the 'Data pipeline' page on your PostHog dashboard.

  2. Search for 'Engage', select the app, and click the "Configure" button.

  3. If you cannot find 'Engage', you need to enable data pipeline on your PostHog account. Go to Billing -> Products -> Data pipeline and click the "Add" button. Once enabled, you can go back to "Data pipeline" to search for Engage.

  4. Enter your Engage API keys as requested. Your Engage API keys are available on the account settings page of your Engage dashboard (Settings -> Account -> API keys). This is used to send your PostHog events to Engage.

  5. If you only want to send events for identified users, change the Event filter field from 'Send events for all users' to 'Only send events for identified users'.

  6. Click 'Save' and the 'Enable' button.

Once setup is complete, PostHog will start sending your events to Engage.

Tracked Events

The integration only tracks your Custom, $identify, and $groupidentify events.

Event Properties

Extra event properties and metadata from PostHog are also processed and sent to Engage. The example below using the PostHog JS SDK appends extra properties to identify. These extra properties will be sent as well to Engage.

posthog.identify(
    '[user unique id]', // distinct_id, required
    { userProperty: 'value1' }, // $set, optional
    { anotherUserProperty: 'value2' } // $set_once, optional
);

Learn more.

Default PostHog User Properties

PostHog automatically adds some default user properties like:

  • $browser

  • $browser_version

  • $os

  • $referrer

  • $referring_domain

and many more. By default, Engage ignores these properties (properties that start with $). However, you can whitelist default user properties you want Engage to add to user profiles. To do this:

  • Visit the Integrations page on your Engage dashboard (Settings -> Integrations)

  • Scroll to PostHog and click the "Settings" button

  • In the "Standard PostHog properties to allow" section, the properties you want to whitelist.

User profile enrichment

When a user you have "identified" before you enable the Engage PostHog integration performs an event, PostHog sends that event to Engage on behalf of the user. However, because the user was identified before Engage's integration, Engage has no idea who the user is—their attributes are missing on Engage. For such users, the only attribute you will see on the profile on Engage is their ID.

There are two ways to solve this.

1. Only send events for identified users

On the Engage settings page on PostHog (Data pipeline -> Engage), you can set Engage to 'Only send events for identified users'. This means only users identified after the integration is enabled will be sent to Engage.

2. Get user properties from PostHog

If a user is not recognized on Engage, you can set Engage to check if the user has already been identified on PostHog. Engage will use the user's ID to check their profile on PostHog for their properties. You will need to add your PostHog Project ID and create a Personal API Key for this.

  • Visit the PostHog settings page on Engage (Settings -> Integrations -> PostHog -> Settings)

  • In the "Enrichment" section, add your Project ID and Personal API key. You can get your PostHog Project ID from the Settings page of your PostHog account.

  • To create a Personal API key,

    • Click on "Personal API keys" on the Settings page of your PostHog account.

    • Click on the "Create personal API key" button

    • Add a label for identification (you can use "Engage")

    • Under "Organization & project access", select the project you have enabled Engage for

    • Under "Scope", scroll to "Person" and select "Read". This will give read-only rights to your user profiles on PostHog. Do the same for "Project" and select "Read".

    • Click on "Create key"

  • Copy the newly created API key to Engage and save the settings.

Was this article helpful?