PostHog Destination

Destination Info
Partner Owned
  • This integration is partner owned. Please reach out to the partner's support for any issues.

PostHog is a self-hosted, open-source analytics product. Get the same powerful features as other product analytics software but keep full control over your data.

This destination is maintained by PostHog. For any issues with the destination, check out the PostHog users slack or contact the PostHog Support team.

Getting Started

  1. From the Destinations catalog page in the Segment App, click Add Destination.
  2. Search for “PostHog” in the Destinations Catalog, and select the PostHog destination.
  3. Choose which Source should send data to the PostHog destination.
  4. Go to your PostHog set up page, and copy the API key.
  5. Enter the PostHog API Key that you copied in the PostHog destination settings in Segment.
  6. Enter your PostHog instance URL as the address to your instance without any trailing slash, for example:
    • https://app.posthog.com if you use PostHog Cloud US
    • https://eu.posthog.com if you use PostHog Cloud EU
    • https://posthog-example.herokuapp.com if you self-host on Heroku

Page

If you aren’t familiar with the Segment Spec, take a look at the Page method documentation to learn about what it does. An example call would look like:

analytics.page()

Segment sends Page calls to PostHog as a $pageview.

Screen

If you aren’t familiar with the Segment Spec, take a look at the Screen method documentation to learn about what it does. An example call would look like:

[[SEGAnalytics sharedAnalytics] screen:@"Home"];

Segment sends Screen calls to PostHog as a $screen event.

Identify

If you aren’t familiar with the Segment Spec, take a look at the Identify method documentation to learn about what it does. An example call would look like:

analytics.identify('userId123', {
  email: 'john.doe@example.com'
});

Segment sends Identify calls to PostHog as an identify event. Data from Identify calls appears in PostHog under the People tab.

Track

If you aren’t familiar with the Segment Spec, take a look at the Track method documentation to learn about what it does. An example call would look like:

analytics.track('Login Button Clicked')

Segment sends Track calls to PostHog as a track event.

Alias

If you aren’t familiar with the Segment Spec, take a look at the Alias method documentation to learn about what it does. An example call would look like:

analytics.alias('507f191e81')

Segment sends Alias calls to PostHog as an alias event.

Engage

You can send computed traits and audiences generated using Engage to this destination as a user property. To learn more about Engage, schedule a demo.

For user-property destinations, an identify call is sent to the destination for each user being added and removed. The property name is the snake_cased version of the audience name, with a true/false value to indicate membership. For example, when a user first completes an order in the last 30 days, Engage sends an Identify call with the property order_completed_last_30days: true. When the user no longer satisfies this condition (for example, it’s been more than 30 days since their last order), Engage sets that value to false.

When you first create an audience, Engage sends an Identify call for every user in that audience. Later audience syncs only send updates for users whose membership has changed since the last sync.

Real-time to batch destination sync frequency

Real-time audience syncs to PostHog may take six or more hours for the initial sync to complete. Upon completion, a sync frequency of two to three hours is expected.

Settings

Segment lets you change these destination settings from the Segment app without having to touch any code.

Setting Description
API Key
(required)
string. Go to Project Settings to find your Project API Key
PostHog instance (US/EU) string. If you’re using EU, add https://eu.posthog.com. If you’re using US, you can leave this field empty.

This page was last modified: 20 Jun 2023



Get started with Segment

Segment is the easiest way to integrate your websites & mobile apps data to over 300 analytics and growth tools.
or
Create free account