Connecting Chargebee to PostHog
Chargebee is a billing system, so it holds the only complete record of what a subscription business earned — and it sits entirely outside the browser. PostHog can be self-hosted, which changes the calculus entirely: the data stays on infrastructure you control, and so does the responsibility for everything that goes wrong with it. The join between them succeeds or fails on one thing: whether the distinct_id reaches the Chargebee subscription before the conversion happens, because PostHog can only match a conversion it can tie back to a click it recognizes.
Free30 minutesNo obligation
Specific to this pair
PostHog: which product behavior leads to a Chargebee payment
Send Chargebee's payment_succeeded, cancellation and plan changes to PostHog's capture API with distinct_id set to your own user ID, the one used in identify, never the Chargebee customer ID. Attach the company as a group for B2B, include amount, currency, plan and interval, and derive event UUIDs from the Chargebee event ID. Use Chargebee for booked revenue.
PostHog shows what trial users do in the product; Chargebee knows which of them paid. The question this pair answers is which activation steps predict a first payment, and that needs the payment inside PostHog on the same person. Send payment_succeeded, cancellation and plan changes to the capture API with the distinct_id set to your own user ID, the same one you pass to PostHog's identify call when the user logs in.
The Chargebee customer ID is not that distinct_id, so store your user ID on the Chargebee customer or keep a lookup. Sending events with the Chargebee ID creates a separate PostHog person who has billing events and no product usage, which makes every paid user look like they never used the product. For B2B, also attach the company as a PostHog group so a payment lands on the account where several users did the evaluating.
Include amount, currency, plan and billing interval as properties, and set the event UUID from the Chargebee event ID so a webhook retry is ignored. Revenue in PostHog will not reconcile to Chargebee's books, since refunds and credits live in billing; use it to compare cohorts, and use Chargebee for what was earned.
Chargebee → PostHog · what breaks
Why this join usually fails — Chargebee → PostHog
- 01
The distinct_id never reaches Chargebee
The identifier must live on the customer or subscription so it survives a trial period that is longer than any browser cookie you can rely on. Chargebee's hosted checkout is also a different origin, so nothing crosses it by default.
- 02
Trials longer than any cookie
The gap between signup and first payment is where the identifier has to survive, and it is measured in weeks. Browser storage will not do it.
- 03
Self-hosting the analytics and the outage together
The advantage of owning the pipeline is that nothing blocks it. The cost is that when the ingestion instance fills its disk on a Saturday, the events are gone and nobody is paged. Hosted tools fail differently and more visibly.
- 04
Nothing reconciles afterwards
PostHog shows events in the activity view within moments. On a self-hosted instance, check the ingestion lag as well — events that are queued are not events that are lost, and the two need different responses.
Chargebee → PostHog · the fix
What working looks like — Chargebee → PostHog
The distinct_id on every subscription
Conversions arriving in PostHog
The event lands on the person profile and becomes available in insights, funnels and session replay.
Reconciled against the source
Chargebee → PostHog · architecture
How Chargebee and PostHog actually connect
- 1
Chargebee holds the truth
The distinction that matters most here is invoice generated versus payment succeeded. An invoice is a bill you sent; a payment is money you received, and in any business with dunning the gap between them is large.
- 2
PostHog needs a click to match
PostHog needs a distinct_id, an event name and its properties. Self-hosted instances additionally need the ingestion endpoint reachable and the project API key correct, which is a class of failure hosted tools do not have.
- 3
The identifier is the bridge
The distinct_id, captured at the visit and carried into the Chargebee subscription.
- 4
The event source decides reliability
Fire on payment succeeded, not invoice generated, and key the conversion on the billing period so a dunning sequence with four retries produces one conversion rather than four.
- 5
Deduplication at the destination
PostHog deduplicates on the event UUID where supplied. Without one, a retried batch duplicates, and on a self-hosted instance there is no vendor support desk to notice it for you.
Chargebee → PostHog · normal or broken
Working vs. broken, side by side — Chargebee → PostHog
Normal, not a fault
The distinct_id present on the subscription
Sent from the Chargebee payment_succeeded webhook
Deduplicated correctly
PostHog deduplicates on the event UUID where supplied. Without one, a retried batch duplicates, and on a self-hosted instance there is no vendor support desk to notice it for you.
Reconciles with the source
Actually broken
The distinct_id missing on most records
The identifier must live on the customer or subscription so it survives a trial period that is longer than any browser cookie you can rely on. Chargebee's hosted checkout is also a different origin, so nothing crosses it by default.
Sent from the browser
The gap between signup and first payment is where the identifier has to survive, and it is measured in weeks. Browser storage will not do it.
Counted twice, or not at all
The advantage of owning the pipeline is that nothing blocks it. The cost is that when the ingestion instance fills its disk on a Saturday, the events are gone and nobody is paged. Hosted tools fail differently and more visibly.
Nobody has reconciled it
Chargebee → PostHog · diagnose
Diagnostic order — Chargebee → PostHog
- 01
Count subscriptions carrying the distinct_id
- 02
Follow one real conversion end to end
- 03
Check whether the event fires on invoice or on payment
Invoice-based firing counts money you have not received, and in a business with dunning that overstates consistently.
- 04
Check ingestion health and disk before debugging any missing event
On self-hosted instances the answer is infrastructure far more often than it is instrumentation.
- 05
Read the match rate, not the success message
PostHog shows events in the activity view within moments. On a self-hosted instance, check the ingestion lag as well — events that are queued are not events that are lost, and the two need different responses.
Chargebee → PostHog · prove
How it gets proven — Chargebee → PostHog
Source of truth
Chargebee's paid invoices by payment date, net of refunds and failed payments.
- The distinct_id confirmed present on a live subscription.
- Purchase events reconciled per transaction against your billing system, with ingestion lag checked over the same window.
- A dunning sequence confirmed to produce one conversion rather than one per retry.
Chargebee → PostHog · free audit
What we check in the free audit
- Count subscriptions carrying the distinct_id
- Follow one real conversion end to end
- Check whether the event fires on invoice or on payment
- Check ingestion health and disk before debugging any missing event
- Read the match rate, not the success message
Checked against
Chargebee's paid invoices by payment date, net of refunds and failed payments.
Free30 minutesNo obligation
Chargebee → PostHog · when not to buy
When you don't need this — Chargebee → PostHog
- Measure identifier coverage yourself first — pull your last hundred subscriptions and count how many carry the distinct_id.
- If your trial is longer than 90 days, uploading the first payment against the original click cannot work — we will tell you that before quoting.
- If you have no reason to keep the data on your own infrastructure and no team to run it, the hosted product removes the only real downside of this one.
Chargebee → PostHog · what we deliver
What gets built — Chargebee → PostHog
Identifier capture into Chargebee
Write the click identifier to a custom field on the Chargebee customer or subscription when the subscription is created, server-side, rather than relying on the hosted checkout page to carry it.
Event source: the Chargebee payment_succeeded webhook
Fire on payment succeeded, not invoice generated, and key the conversion on the billing period so a dunning sequence with four retries produces one conversion rather than four.
Dispatch to PostHog
The PostHog capture API, posted server-side from your backend to your own instance or to PostHog Cloud.
Reversals where they exist
Cancellations and refunds are exposed and should reverse the lifetime value claimed at acquisition.
Written guarantee
95%+ tracking accuracy
Measured against Chargebee's paid invoices by payment date, net of refunds and failed payments.. Miss it and we keep working at no cost.
From $400 · See packages
FAQ
Chargebee → PostHog questions, answered
Send payment events with your own user ID as the distinct_id, the same one used in PostHog's identify call. Store that ID on the Chargebee customer.
No. Use PostHog to compare which behaviors precede payment; keep revenue, refunds and MRR in Chargebee.
Almost always because the distinct_id never reached the Chargebee subscription. The identifier must live on the customer or subscription so it survives a trial period that is longer than any browser cookie you can rely on. Chargebee's hosted checkout is also a different origin, so nothing crosses it by default. Measure coverage before debugging the dispatch.
PostHog identifies by distinct_id with an alias call to merge anonymous and identified users. On a self-hosted instance you also control the ingestion endpoint, which means the identifier survives ad blockers that would kill a third-party pixel — one of the few genuine technical advantages available to a first-party setup.
The Chargebee payment_succeeded webhook. Fire on payment succeeded, not invoice generated, and key the conversion on the billing period so a dunning sequence with four retries produces one conversion rather than four.
PostHog shows events in the activity view within moments. On a self-hosted instance, check the ingestion lag as well — events that are queued are not events that are lost, and the two need different responses.
More on Chargebee → PostHog
- Chargebee → Google AdsConnecting Chargebee to Google Ads
- Chargebee → MetaConnecting Chargebee to Meta Conversions API
- Chargebee → GA4Connecting Chargebee to GA4
RELATED GUIDES
Where Chargebee → PostHog fits in the rest of your tracking
- Square → PostHogConnecting Square to PostHog
- Affirm → PostHogConnecting Affirm to PostHog
- Authorize.net → PostHogConnecting Authorize.net to PostHog
- Chargebee → Adobe AnalyticsConnecting Chargebee to Adobe Analytics
- Chargebee → MixpanelConnecting Chargebee to Mixpanel
- EcommerceConversion tracking for ecommerce brands, measured against your orders
- Adyen → PostHogConnecting Adyen to PostHog
- Helcim → PostHogConnecting Helcim to PostHog
Free · 30 min
Get Chargebee and PostHog joined properly
Free30 minutesNo obligation
