Connect to customers
Contents
We'll remove the Revenue analytics dashboard on or after June 30th, 2026.
We're not stepping away from revenue in PostHog — we're rethinking how it should work. Instead of maintaining a single, opinionated Revenue analytics dashboard, we're focusing on exposing revenue properties on persons and groups so you can use them everywhere: insights, SQL, and persons/groups profiles. Each use case (ecommerce, SaaS, recurring revenue, one-off, services, multi-tenant) can then build the dashboard it actually needs — or have PostHog AI and agents via our MCP build it for you.
PostHog automatically connects revenue data to persons and groups when you use revenue events. For data warehouse sources, you need to map the connection manually.
Step 1: Add metadata when creating new customers
Search your codebase for where you create Stripe customers (e.g. stripe.Customer.create or equivalent) and add the posthog_person_distinct_id metadata field.
Step 2: Tag existing customers via charges, subscriptions, or invoices
For customers created before you added the metadata in step 1, you don't need to update the customer object directly. Instead, pass posthog_person_distinct_id as metadata on any charge, subscription, or invoice tied to that customer. PostHog automatically resolves it from the most recently created child object.
Add the metadata to whichever Stripe call you already make. Here are the most common patterns:
Subscriptions
One-off charges (payment intents)
Stripe Checkout
Pass the metadata in the checkout session's subscription_data or payment_intent_data depending on your checkout mode. Also set client_reference_id to your internal user ID so you can look up the distinct ID.
How does this work? PostHog looks for
posthog_person_distinct_idin the metadata of subscriptions, charges, and invoices tied to each Stripe customer. If the customer object doesn't have the metadata directly, PostHog uses the value from the most recently created child object.
Once this is connected you'll be able to properly see who your top customers are in the Top customers dashboard.
You'll also get access to the persons_revenue_analytics and groups_revenue_analytics tables in the data warehouse. This is a simple map of person_id/group_key to what their all-time revenue is.