PostHog Integration
The PostHog integration sends your project's traces, generations and scores to a PostHog project as events, so you can chart LLM usage, cost and quality next to your product analytics.
What is sent
| PostHog event | Source |
|---|---|
langfuse trace | One event per trace |
langfuse generation | One event per generation |
langfuse score | One event per score |
Each event uses the trace's user ID as the PostHog distinct ID, or
langfuse_unknown_user when the trace has no user. When you turn the
integration on, all historical data in the project is synced. After that, new
data is synced every hour, at 30 minutes past the hour. The page shows Data
synced until with the time of the last sync.
Requirements
- A PostHog project and its project API key (starts with
phc_). Use the project key, not a personal API key. - In ANTS Platform, the Owner role, or a custom role with write access to Integrations (notification and analytics integrations). See Members & Roles.
Connect PostHog
Open the integration
Go to Project Settings > Integrations and open the PostHog card.
Enter the connection details
| Field | Value |
|---|---|
| Posthog Hostname | Your PostHog host, for example https://us.posthog.com, https://eu.posthog.com or your self-hosted URL |
| Posthog Project API Key | The phc_... key from your PostHog project settings |
| Enabled | On to sync |
The API key is encrypted at rest.
Save
Save the settings. The first sync runs at the next half past the hour.