Connecting Clerk to GA4
Clerk handles both authentication and organisation membership, which matters for B2B products where the paying entity is a company and the signing-up entity is a person. 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 Clerk user and organisation 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
Clerk signups in GA4: user_id per person, purchase per org
Set GA4's user_id to the Clerk user ID and send sign_up from the user.created webhook only for organization creators or uninvited signups. When the organization pays, send one Measurement Protocol purchase using the first member's stored client_id and session_id, with the billing invoice or subscription ID as transaction_id.
GA4 is the one destination where per-user data is useful rather than misleading, as long as the purchase is not. Set GA4's user_id to the Clerk user ID so a person's visits across devices join, and send sign_up from the Clerk user.created webhook. When the organization pays, send one purchase event through Measurement Protocol using the client_id and session_id stored on the first member, with transaction_id set to the billing system's invoice or subscription ID.
Store the _ga client_id at signup in the user's unsafeMetadata or your own database, because the paid conversion usually comes after a trial and the visitor's session is long gone. Measurement Protocol will not start a new session for it, so check how your property attributes key events arriving without one before trusting channel reports. Mark sign_up and purchase as key events separately so seat invitations do not inflate conversion rates.
The break specific to Clerk is invited teammates. Each accepted invitation creates a Clerk user and, if you send sign_up on every user.created, a new GA4 conversion. Send sign_up only when a user creates an organization or signs up without an invitation, and record invited members as a separate event.
Clerk → GA4 · what breaks
Why this join usually fails — Clerk → GA4
- 01
The GA4 client_id never reaches Clerk
Several people from one company sign up separately, each carrying a different acquisition source.
- 02
Counting seats instead of customers
Five colleagues signing up from one company is one paying customer and five conversions if attribution sits on the user. Cost per acquisition then reads as a fifth of reality.
- 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.
- 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.
Clerk → GA4 · the fix
What working looks like — Clerk → GA4
The GA4 client_id on every account
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
Clerk → GA4 · architecture
How Clerk and GA4 actually connect
- 1
Clerk holds the truth
In B2B SaaS the subscription belongs to an organisation and several users belong to it. Attributing revenue per user counts one customer several times.
- 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
The identifier is the bridge
The GA4 client_id, captured at the visit and carried into the Clerk user and organisation.
- 4
The event source decides reliability
Send paid conversions per organisation, deduplicated across its users.
- 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.
Clerk → GA4 · normal or broken
Working vs. broken, side by side — Clerk → GA4
Normal, not a fault
The GA4 client_id present on the account
Sent from your billing system, keyed on the organisation
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
Several people from one company sign up separately, each carrying a different acquisition source.
Sent from the browser
Five colleagues signing up from one company is one paying customer and five conversions if attribution sits on the user. Cost per acquisition then reads as a fifth of reality.
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
Clerk → GA4 · diagnose
Diagnostic order — Clerk → GA4
- 01
Count accounts carrying the GA4 client_id
- 02
Follow one real conversion end to end
- 03
Compare user signups against paying organisations
The ratio is the size of the overcount, and in B2B products it is rarely close to one.
- 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.
- 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.
Clerk → GA4 · prove
How it gets proven — Clerk → GA4
Source of truth
Your billing system, joined to the Clerk organisation rather than the user.
- The GA4 client_id confirmed present on a live account.
- Server events confirmed in DebugView attaching to an existing session with the original traffic source intact.
- Paid conversions reconciled per organisation against imported conversions, deduplicated across users.
Clerk → GA4 · free audit
What we check in the free audit
- Count accounts carrying the GA4 client_id
- Follow one real conversion end to end
- Compare user signups against paying organisations
- Check whether server events carry a session and a source
- Read the match rate, not the success message
Checked against
Your billing system, joined to the Clerk organisation rather than the user.
Free30 minutesNo obligation
Clerk → GA4 · when not to buy
When you don't need this — Clerk → GA4
- Measure identifier coverage yourself first — pull your last hundred accounts and count how many carry the GA4 client_id.
- Consumer products where one user is one customer do not have this distinction.
- 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.
Clerk → GA4 · what we deliver
What gets built — Clerk → GA4
Identifier capture into Clerk
Store the identifier on the user and attribute at the organisation, using the first user's source with the others recorded as supporting.
Event source: your billing system, keyed on the organisation
Send paid conversions per organisation, deduplicated across its users.
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 reverse against the organisation.
Written guarantee
95%+ tracking accuracy
Measured against Your billing system, joined to the Clerk organisation rather than the user.. Miss it and we keep working at no cost.
From $400 · See packages
FAQ
Clerk → GA4 questions, answered
Yes, for stitching a person's sessions. Do not use it to attribute revenue; send the purchase once per organization with the first member's stored client_id.
Invited teammates each create a Clerk user. Exclude invitation signups from the sign_up key event, or report signups and paying organizations as separate events.
Almost always because the GA4 client_id never reached the Clerk user and organisation. Several people from one company sign up separately, each carrying a different acquisition source. Measure coverage before debugging the dispatch.
The client_id, from the _ga cookie. Measurement Protocol events without it are rejected or create a brand-new user with no session and no source, which is how server events end up filed under (direct)/(none) and make paid channels look worse than they are. Send session_id alongside it so the event joins the existing session, and include engagement_time_msec or the event may not appear as expected in reports.
Your billing system, keyed on the organisation. Send paid conversions per organisation, deduplicated across its users.
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.
More on Clerk → GA4
- Stripe → GA4Connecting Stripe to GA4
- PayPal → GA4Connecting PayPal to GA4
- HubSpot → GA4Connecting HubSpot to GA4
RELATED GUIDES
Where Clerk → GA4 fits in the rest of your tracking
- Okta → GA4Connecting Okta to GA4
- Auth0 → GA4Connecting Auth0 to GA4
- Supabase Auth → GA4Connecting Supabase Auth to GA4
- Clerk → MixpanelConnecting Clerk to Mixpanel
- Clerk → MatomoConnecting Clerk to Matomo
- SaaSConversion tracking for SaaS, from signup through to the payment that matters
- Firebase Auth → GA4Connecting Firebase Authentication to GA4
Free · 30 min
Get Clerk and GA4 joined properly
Free30 minutesNo obligation
