RudderStack

Last updated:

RudderStack is an open-source, customer data platform for developers. It allows you to collect and deliver customer event data to a variety of destinations across your growth, product, and marketing stack.

Before integrating with RudderStack, we recommend you read our CDP integration guide to understand the different options for integrating with PostHog.

Setting up the RudderStack Import

Make sure you have a RudderStack account and a PostHog account, using PostHog Cloud or self-hosting.

  1. From your RudderStack dashboard, add each source and select PostHog from the list of destinations.
  2. Assign a name to your destination (e.g. PostHog production) and click Continue.
  3. Add your PostHog 'Project API Key' as the Team API key (Do not use a Personal API key) and your host url as Your-Instance ('<ph_instance_address>' if you're on PostHog Cloud): RudderStack Dashboard
    • If it's a website or web app:
      1. In the rudderstack console set Use device-mode to send events to true so that the events originate from the client side. Additionally, this will enable the toolbar and heatmaps.
      2. Set Enable autocapture with PostHog to true. This will automatically capture events from your website or web app
        RudderStack Dashboard
    • If it's not a website or web app (e.g. a mobile app or server), to use the full set of features such as feature flags and session recordings manually install the PostHog SDK docs in addition to adding PostHog as the event destination in RudderStack.

For more information see the RudderStack guide for setting up PostHog

Sending events to PostHog

Once you have set up RudderStack and PostHog, you can use RudderStack to send events to PostHog. You can send events through the RudderStack API, or one of the RudderStack libraries. For example, with javascript you can use the analytics.track('Event Name') function which will send the events to your RudderStack destinations including PostHog.

For the full list of functions see the relevant SDK docs e.g. the Javascript SDK.

Questions?

Was this page useful?

Next article

Segment

Segment is a Customer Data Platform (CDP) that allows you to easily manage data and integrations with services across your growth, product, and marketing stack. By tracking events and users via Segment’s API and libraries, you can send your product’s data to all of your analytics/marketing platforms, with minimal instrumentation code. They offer support for most platforms, including iOS, Android, JavaScript, Node.js, PHP, and more. Before integrating with Segment, we recommend you read our CDP…

Read next article