Skip to main content
Chargebee → GA4Integration guide

Connecting Chargebee to GA4

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. GA4 is where the business goes to understand what happened, which makes an unattributed conversion there expensive in decisions rather than in ad spend. The join between them succeeds or fails on one thing: whether the GA4 client_id reaches the Chargebee subscription before the conversion happens, because GA4 can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Chargebee payments in GA4 without trial revenue landing as (direct)

Write GA4's _ga client_id and session_id to Chargebee customer custom fields at signup, then send purchase via Measurement Protocol from payment_succeeded with the invoice ID as transaction_id. The payment lands on the user, not the trial session, so analyze by first user source and send sign_up from the browser. Track sent invoices, and name renewals separately.

GA4 and Chargebee disagree about time. A trial signup happens in a browser session GA4 can see; the first payment happens 14 or 30 days later inside Chargebee with no browser at all. Measurement Protocol will record that payment, but only against the client_id you saved at signup: write the _ga client_id and session_id to Chargebee customer custom fields when the subscription is created, and send purchase from the payment_succeeded webhook using them.

Even then, the first payment will not inherit the trial session's source in GA4's session-scoped reports. A Measurement Protocol event weeks later lands on the user, not in a session with a campaign. Analyze subscription revenue by the user-scoped first user source dimensions, and send sign_up from the browser at signup so the campaign is recorded where GA4 can attribute it.

Use the Chargebee invoice ID as transaction_id and keep a record of which invoices you have sent, because Chargebee retries webhook deliveries and GA4 should not be trusted to drop the repeat. Decide whether renewals belong in GA4 at all: sending every monthly renewal as purchase makes GA4 revenue track MRR, which is accurate but buries acquisition. A separately named renewal event keeps the two apart. Refunds go as a refund event with the original invoice's transaction_id.

Chargebee → GA4 · what breaks

Why this join usually fails — Chargebee → GA4

  1. 01

    The GA4 client_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.

  2. 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.

  3. 03

    Everything lands under (direct)/(none)

    The classic Measurement Protocol symptom, and it always means the same thing: the client_id was missing or wrong, so GA4 had no session to attach the event to and invented a new user.

  4. 04

    Nothing reconciles afterwards

    GA4 DebugView shows events arriving with their parameters, and Realtime confirms the user and session they attached to. Neither tells you whether you are double-counting — for that, compare GA4's conversion count against the source system's record for the same window.

Chargebee → GA4 · the fix

What working looks like — Chargebee → GA4

  • The GA4 client_id on every subscription

  • Conversions arriving in GA4

    Conversions appear in GA4 attributed to the original session's source and medium, so acquisition reporting reflects what actually drove revenue.

  • Reconciled against the source

Chargebee → GA4 · architecture

How Chargebee and GA4 actually connect

  1. 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. 2

    GA4 needs a click to match

    GA4 needs the client_id to attach a server event to the user and session that produced the click. Without it there is no attribution to inherit and the event is orphaned.

  3. 3

    The identifier is the bridge

    The GA4 client_id, captured at the visit and carried into the Chargebee subscription.

  4. 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. 5

    Deduplication at the destination

    GA4 has no built-in deduplication for Measurement Protocol. If the browser also sends the event, it counts twice. The only reliable approach is to decide per event which side sends it, and enforce that decision — GA4 will not protect you from your own duplicates.

Chargebee → GA4 · normal or broken

Working vs. broken, side by side — Chargebee → GA4

Normal, not a fault

  • The GA4 client_id present on the subscription

  • Sent from the Chargebee payment_succeeded webhook

  • Deduplicated correctly

    GA4 has no built-in deduplication for Measurement Protocol. If the browser also sends the event, it counts twice. The only reliable approach is to decide per event which side sends it, and enforce that decision — GA4 will not protect you from your own duplicates.

  • Reconciles with the source

Actually broken

  • The GA4 client_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 classic Measurement Protocol symptom, and it always means the same thing: the client_id was missing or wrong, so GA4 had no session to attach the event to and invented a new user.

  • Nobody has reconciled it

Chargebee → GA4 · diagnose

Diagnostic order — Chargebee → GA4

  1. 01

    Count subscriptions carrying the GA4 client_id

  2. 02

    Follow one real conversion end to end

  3. 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.

  4. 04

    Check whether server events carry a session and a source

    In GA4 Realtime or DebugView, find the event and look at its session and traffic source. A brand-new user with no source on every server event is the missing-client_id signature.

  5. 05

    Read the match rate, not the success message

    GA4 DebugView shows events arriving with their parameters, and Realtime confirms the user and session they attached to. Neither tells you whether you are double-counting — for that, compare GA4's conversion count against the source system's record for the same window.

Chargebee → GA4 · prove

How it gets proven — Chargebee → GA4

Source of truth

Chargebee's paid invoices by payment date, net of refunds and failed payments.

  • The GA4 client_id confirmed present on a live subscription.
  • Server events confirmed in DebugView attaching to an existing session with the original traffic source intact.
  • A dunning sequence confirmed to produce one conversion rather than one per retry.

Chargebee → GA4 · free audit

What we check in the free audit

  • Count subscriptions carrying the GA4 client_id
  • Follow one real conversion end to end
  • Check whether the event fires on invoice or on payment
  • Check whether server events carry a session and a source
  • Read the match rate, not the success message

Checked against

Chargebee's paid invoices by payment date, net of refunds and failed payments.

Get my free conversion tracking audit

Free30 minutesNo obligation

Chargebee → GA4 · when not to buy

When you don't need this — Chargebee → GA4

  • Measure identifier coverage yourself first — pull your last hundred subscriptions and count how many carry the GA4 client_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.
  • GA4 is reporting, not bidding. If your problem is ad platform optimization, fix the ad platform destination first — GA4 will not change what any campaign does.

Chargebee → GA4 · what we deliver

What gets built — Chargebee → GA4

  • 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 GA4

    Measurement Protocol events with the client_id, session_id and the correct measurement ID and API secret, sent server-side.

  • 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.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Chargebee → GA4 questions, answered

The payment arrives through Measurement Protocol without a session, or with a new client_id, so GA4 has no campaign to attach. Store the signup client_id on the Chargebee customer and read revenue by first user source.

Free · 30 min

Get Chargebee and GA4 joined properly

Free30 minutesNo obligation