PostHog
Connecting PostHog works by using PostHog's Kinesis destination to send events to our AWS PostHog connector. This setup uses Kinesis under the hood to enable real-time, secure, and scalable event ingestion. With this setup we're able to ingest events in real-time directly in a secure and scalable way.
This guide walks you through how to setup a a PostHog to AWS Kinesis destination, including how to setup a Shaped AWS PostHog connector that consumes from the PostHog destination.
1. Setting up a Shaped PostHog connector
That guide outlines how to configure a PostHog dataset and run the CLI command (shaped create-dataset --file dataset_schema.yml,
) so that Shaped will provision the stream for you and manage its lifecycle.
Once the dataset becomes ACTIVE
, you’ll receive the stream ARN from Shaped to enable event delivery.
The dataset schema mirrors the structure of a PostHog event. For example, an example schema for creating your dataset might look like:
name: example_posthog_events
schema_type: POSTHOG
unique_keys: [event.uuid]
column_schema:
event:
uuid: String # Unique identifier for the PostHog event
distinct_id: String # The user/session identifier associated with the event
timestamp: DateTime # When the event occurred
event: String # Event name (e.g., "$pageview")
elements_chain: String # Serialized elements chain (used for autocapture)
url: String # URL of the page where the event was captured
properties: String # JSON string of custom event properties
2. Configure PostHog Data Pipeline
The user keys and stream information required to configure Posthog will be provided by Shaped.
In PostHog, go to Data pipeline → Destinations → + Create → AWS Kinesis.
Enter the following values:
- AWS Access Key ID → from IAM user
- AWS Secret Access Key → from IAM user
- AWS Region → region of your stream
- Kinesis Stream Name →
<your-provisioned-stream>
which will be provided by Shaped - Kinesis Partition Key → optional (e.g.
user_id
)
Click Create & Enable.