Connecting Umbraco to GA4
Umbraco is a .NET CMS common in mid-market and enterprise European organisations, which means IT governance is usually the binding constraint rather than technology. 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 Umbraco Commerce order 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
Umbraco to GA4: purchase from the finalize handler, not the view
Umbraco Commerce often finalizes orders in a payment callback with no _ga cookie, so save the GA4 client_id and session ID as order properties during checkout. The finalization handler then sends purchase through the Measurement Protocol with order-line items, tax, shipping and the order's own currency. Don't also push a cached confirmation-page purchase.
In Umbraco Commerce the order is usually finalized during the payment provider's callback, a server-to-server request with no _ga cookie on it. Capture the client_id and session ID from the visitor's cookies earlier, during checkout, and save them as order properties; the finalization notification handler then reads them from the order and sends purchase through the Measurement Protocol.
Do not also push a purchase into the dataLayer from the confirmation view unless you have decided which side owns it. A confirmation view served through output caching or a CDN can replay the dataLayer on refresh or for another visitor, and GA4 counts each one. If you want a browser purchase for ecommerce reports, send it with the order number as transaction_id and drop the server event.
Send items from the order lines with the product SKU, the tax and shipping the order holds, and the order's own currency code. Umbraco Commerce stores can run their own currencies; send the currency on the order rather than assuming the site default, or GA4 converts at the wrong rate.
Umbraco → GA4 · what breaks
Why this join usually fails — Umbraco → GA4
- 01
The GA4 client_id never reaches Umbraco
Output caching and CDN layers sit in front of most Umbraco deployments, and the deployment process itself frequently prevents quick iteration, which means getting the capture right the first time matters more here.
- 02
Change control, not technology
The build is straightforward and the release cycle is not. Scope the deployment process before committing to a timeline, because in this segment it is the schedule.
- 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.
Umbraco → GA4 · the fix
What working looks like — Umbraco → GA4
The GA4 client_id on every order
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
Umbraco → GA4 · architecture
How Umbraco and GA4 actually connect
- 1
Umbraco holds the truth
You own the database. What you may not own is the release process — Umbraco sites in this segment often sit behind change control that adds weeks to any modification.
- 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 Umbraco Commerce order.
- 4
The event source decides reliability
Fire from the .NET notification handler rather than a view, which may be cached at the edge.
- 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.
Umbraco → GA4 · normal or broken
Working vs. broken, side by side — Umbraco → GA4
Normal, not a fault
The GA4 client_id present on the order
Sent from the Umbraco Commerce order-finalised notification
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
Output caching and CDN layers sit in front of most Umbraco deployments, and the deployment process itself frequently prevents quick iteration, which means getting the capture right the first time matters more here.
Sent from the browser
The build is straightforward and the release cycle is not. Scope the deployment process before committing to a timeline, because in this segment it is the schedule.
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
Umbraco → GA4 · diagnose
Diagnostic order — Umbraco → GA4
- 01
Count orders carrying the GA4 client_id
- 02
Follow one real conversion end to end
- 03
Establish the deployment and change-control process first
It determines the timeline more than any technical question here.
- 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.
Umbraco → GA4 · prove
How it gets proven — Umbraco → GA4
Source of truth
Umbraco Commerce's order records in your own database, at agreed order states.
- The GA4 client_id confirmed present on a live order.
- Server events confirmed in DebugView attaching to an existing session with the original traffic source intact.
- Order data confirmed populated on an order placed through the CDN as an anonymous visitor.
Umbraco → GA4 · free audit
What we check in the free audit
- Count orders carrying the GA4 client_id
- Follow one real conversion end to end
- Establish the deployment and change-control process first
- Check whether server events carry a session and a source
- Read the match rate, not the success message
Checked against
Umbraco Commerce's order records in your own database, at agreed order states.
Free30 minutesNo obligation
Umbraco → GA4 · when not to buy
When you don't need this — Umbraco → GA4
- Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the GA4 client_id.
- If the site is maintained by an internal IT team on a quarterly release cycle, plan the engagement around that rather than around the code.
- 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.
Umbraco → GA4 · what we deliver
What gets built — Umbraco → GA4
Identifier capture into Umbraco
Capture the identifier and persist it to the order through a server-side notification handler in the application.
Event source: the Umbraco Commerce order-finalised notification
Fire from the .NET notification handler rather than a view, which may be cached at the edge.
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
Order state changes to refunded or cancelled are recorded.
Written guarantee
95%+ tracking accuracy
Measured against Umbraco Commerce's order records in your own database, at agreed order states.. Miss it and we keep working at no cost.
From $400 · See packages
FAQ
Umbraco → GA4 questions, answered
Store the GA4 client_id and session ID as order properties during checkout, then send purchase from a handler on the order-finalized notification. The payment callback itself carries no visitor cookies.
A cached or refreshed confirmation page can fire the browser purchase again, or both browser and server send it. Choose one sender.
Almost always because the GA4 client_id never reached the Umbraco Commerce order. Output caching and CDN layers sit in front of most Umbraco deployments, and the deployment process itself frequently prevents quick iteration, which means getting the capture right the first time matters more here. 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.
The Umbraco Commerce order-finalised notification. Fire from the .NET notification handler rather than a view, which may be cached at the edge.
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 Umbraco → GA4
- Stripe → GA4Connecting Stripe to GA4
- PayPal → GA4Connecting PayPal to GA4
- HubSpot → GA4Connecting HubSpot to GA4
RELATED GUIDES
Where Umbraco → GA4 fits in the rest of your tracking
- Sanity → GA4Connecting Sanity to GA4
- Ghost → GA4Connecting Ghost memberships to GA4
- Statamic → GA4Connecting Statamic to GA4
- Umbraco → PostHogConnecting Umbraco to PostHog
- Umbraco → MixpanelConnecting Umbraco to Mixpanel
- Local servicesConversion tracking for local businesses, where most conversions bypass the website
- Drupal Commerce → GA4Connecting Drupal Commerce to GA4
- Concrete CMS → GA4Connecting Concrete CMS to GA4
Free · 30 min
Get Umbraco and GA4 joined properly
Free30 minutesNo obligation
