Connecting Firebase Authentication to GA4
Firebase Auth is usually the identity layer in a mobile-first product, which means the user ID it issues is the only thing connecting a web visit to an in-app purchase. 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 Firebase user identity 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
Firebase Auth in GA4: one user_id across the web and app streams
Set the GA4 user_id to the Firebase uid, never email, on both web and app streams at sign-in. Send web-attributed purchases via Measurement Protocol with the captured client_id, and app purchases with firebase_app_id and app_instance_id. Make sign-up link anonymous accounts rather than starting a fresh sign-in, then confirm one user_id spans both stages.
GA4 is the destination where Firebase Auth fits most naturally, because Firebase's own Analytics SDK reports into a GA4 app stream. Set the GA4 user_id to the Firebase uid on both the web data stream and the app stream at sign-in, and GA4 can stitch a user who clicked an ad on the web and paid in the app. Never use the email as user_id; the uid is opaque, which is what GA4's policy needs.
Server events have two shapes here. Purchases attributed to the web session go through Measurement Protocol with the web client_id you captured before sign-up. Purchases from the app stream need firebase_app_id and app_instance_id instead of client_id; check which stream your billing event belongs to, because sending an app purchase with a web client_id files it against the wrong platform.
Anonymous auth breaks GA4 quietly. If a visitor signs in anonymously, browses, then creates an account with a new credential instead of linking, the uid changes and the paying user_id has no history. Firebase's account linking keeps the anonymous uid when the credential is attached; check your sign-up code calls linking rather than a fresh sign-in, then confirm in GA4's user explorer that one user_id spans both stages.
Firebase Auth → GA4 · what breaks
Why this join usually fails — Firebase Auth → GA4
- 01
The GA4 client_id never reaches Firebase Auth
Anonymous authentication creates users before signup, and linking an anonymous account to a real one is a step teams frequently skip.
- 02
Anonymous accounts never linked to real ones
Firebase's anonymous auth is convenient and creates a separate user. If it is not linked at signup, the pre-signup activity and the paying customer are two different people in every downstream system.
- 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.
Firebase Auth → GA4 · the fix
What working looks like — Firebase Auth → 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
Firebase Authentication's own records are the reference, not either dashboard.
Firebase Auth → GA4 · architecture
How Firebase Auth and GA4 actually connect
- 1
Firebase Authentication holds the truth
Firebase holds identity, not revenue. Its value to measurement is that it gives a stable key that survives the web-to-app transition where every cookie dies.
- 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 Firebase user identity.
- 4
The event source decides reliability
Send paid conversions keyed on the user identity. Signups and anonymous sessions are stages, not revenue.
- 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.
Firebase Auth → GA4 · normal or broken
Working vs. broken, side by side — Firebase Auth → GA4
Normal, not a fault
The GA4 client_id present on the account
Visible on the record itself in Firebase Authentication, not merely captured somewhere on the site.
Sent from your billing system, keyed on the user ID
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
GA4's count and Firebase Authentication's records agree within a few percent over a closed window.
Actually broken
The GA4 client_id missing on most records
Anonymous authentication creates users before signup, and linking an anonymous account to a real one is a step teams frequently skip.
Sent from the browser
Firebase's anonymous auth is convenient and creates a separate user. If it is not linked at signup, the pre-signup activity and the paying customer are two different people in every downstream system.
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
The dashboard shows a number and no one has compared it to Firebase Authentication.
Firebase Auth → GA4 · diagnose
Diagnostic order — Firebase Auth → GA4
- 01
Count accounts carrying the GA4 client_id
- 02
Follow one real conversion end to end
- 03
Check whether anonymous accounts are linked or orphaned at signup
Orphaned anonymous users are the most common Firebase identity failure and they silently break every cross-signup funnel.
- 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.
Firebase Auth → GA4 · prove
How it gets proven — Firebase Auth → GA4
Against Firebase Authentication's own records, not against either platform's dashboard.
Source of truth
Your billing system, keyed on the Firebase user ID.
- 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 linked user identity against imported conversions.
Firebase Auth → GA4 · free audit
What we check in the free audit
- Count accounts carrying the GA4 client_id
- Follow one real conversion end to end
- Check whether anonymous accounts are linked or orphaned at signup
- Check whether server events carry a session and a source
- Read the match rate, not the success message
Checked against
Your billing system, keyed on the Firebase user ID.
Free30 minutesNo obligation
Firebase Auth → GA4 · when not to buy
When you don't need this — Firebase Auth → GA4
- If GA4 already reports conversions that reconcile against Firebase Authentication's records within a few percent, this join is working and there is nothing to buy.
- Measure identifier coverage yourself first — pull your last hundred accounts and count how many carry the GA4 client_id.
- If you do not use anonymous auth, the linking problem does not arise.
- 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.
Firebase Auth → GA4 · what we deliver
What gets built — Firebase Auth → GA4
Identifier capture into Firebase Auth
Capture the identifier on the web, write it to custom claims or your own user document at first auth, and link anonymous accounts rather than creating duplicates.
Event source: your billing system, keyed on the user ID
Send paid conversions keyed on the user identity. Signups and anonymous sessions are stages, not revenue.
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 same identity.
Written guarantee
95%+ tracking accuracy
Measured against Your billing system, keyed on the Firebase user ID.. Miss it and we keep working at no cost.
From $400 · See packages
FAQ
Firebase Auth → GA4 questions, answered
Yes. It is stable, not personally identifiable on its face, and available on both web and app, which is what lets GA4 join the two streams.
App stream events need firebase_app_id and app_instance_id rather than a web client_id. Check that the payload matches the stream it is sent to.
Almost always because the GA4 client_id never reached the Firebase user identity. Anonymous authentication creates users before signup, and linking an anonymous account to a real one is a step teams frequently skip. 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 user ID. Send paid conversions keyed on the user identity. Signups and anonymous sessions are stages, not revenue.
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 Firebase Auth → GA4
- Firebase Auth → Google AdsConnecting Firebase Authentication to Google Ads
- Firebase Auth → MetaConnecting Firebase Authentication to Meta Conversions API
- Firebase Auth → HubSpotConnecting Firebase Authentication to HubSpot
RELATED GUIDES
Where Firebase Auth → 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
- Firebase Auth → MatomoConnecting Firebase Authentication to Matomo
- Firebase Auth → PostHogConnecting Firebase Authentication to PostHog
- B2BConversion tracking for B2B, from first touch to closed-won
- Clerk → GA4Connecting Clerk to GA4
Free · 30 min
Get Firebase Auth and GA4 joined properly
Free30 minutesNo obligation
