Connecting Saleor to GA4
Saleor is headless and GraphQL-first, which means the storefront and the commerce engine are separate applications and the identifier has to survive a boundary that traditional platforms do not have. 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 Saleor 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
Saleor in GA4: client_id in checkout metadata, purchase from the API
Write GA4's client_id and session_id into Saleor checkout privateMetadata before checkoutComplete. Send purchase from the ORDER_FULLY_PAID webhook via Measurement Protocol with the Saleor order number as transaction_id, net value and the channel's currency, and drop any browser purchase to avoid double counting. Send refunds with the same transaction_id, and separate app and POS orders.
On Saleor, the storefront holds the _ga cookie and the API holds the order, so the GA4 client_id and session_id have to be written onto the checkout through the API before checkoutComplete. Use privateMetadata rather than public metadata, since public metadata is readable by any storefront client with the checkout token. Confirm in your Saleor version that checkout metadata carries onto the order it creates.
Send purchase from the ORDER_FULLY_PAID webhook rather than the storefront, with transaction_id set to the Saleor order number, value as the order total net of tax and shipping as you report it, and currency from the order's channel. Saleor channels can price in different currencies; GA4 converts to the property currency only if currency is sent per event.
If the storefront also fires a browser purchase on the confirmation page, GA4 will count both; it does not deduplicate Measurement Protocol. Pick the webhook. Refunds go out from ORDER_REFUNDED or the fully refunded event as a refund with the same transaction_id. Orders from non-web clients, such as a mobile app or a POS, have no client_id and should be excluded or tagged as their own source rather than appearing as direct.
Saleor → GA4 · what breaks
Why this join usually fails — Saleor → GA4
- 01
The GA4 client_id never reaches Saleor
The storefront holds the browser session; the commerce API holds the order. Nothing carries between them unless the storefront puts it there.
- 02
A storefront that knows the click and an API that holds the money
Headless architectures split exactly the two things attribution needs to join. If the storefront does not deliberately write the identifier into order metadata, the connection does not exist anywhere.
- 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.
Saleor → GA4 · the fix
What working looks like — Saleor → 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
Saleor → GA4 · architecture
How Saleor and GA4 actually connect
- 1
Saleor holds the truth
In a headless setup the storefront is one of several possible clients. Attributing from it means measuring one channel of a system designed to have many.
- 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 Saleor order.
- 4
The event source decides reliability
Send fully paid orders at their net total, sourced from the API.
- 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.
Saleor → GA4 · normal or broken
Working vs. broken, side by side — Saleor → GA4
Normal, not a fault
The GA4 client_id present on the order
Sent from the Saleor order 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 storefront holds the browser session; the commerce API holds the order. Nothing carries between them unless the storefront puts it there.
Sent from the browser
Headless architectures split exactly the two things attribution needs to join. If the storefront does not deliberately write the identifier into order metadata, the connection does not exist anywhere.
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
Saleor → GA4 · diagnose
Diagnostic order — Saleor → GA4
- 01
Count orders carrying the GA4 client_id
- 02
Follow one real conversion end to end
- 03
Inspect order metadata on a live order for the identifier
Either it is on the order or the attribution is guesswork. There is no middle state.
- 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.
Saleor → GA4 · prove
How it gets proven — Saleor → GA4
Source of truth
Saleor orders by payment status, read from the API rather than inferred from the storefront.
- 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.
- Paid orders reconciled from the API against imported conversions.
Saleor → GA4 · free audit
What we check in the free audit
- Count orders carrying the GA4 client_id
- Follow one real conversion end to end
- Inspect order metadata on a live order for the identifier
- Check whether server events carry a session and a source
- Read the match rate, not the success message
Checked against
Saleor orders by payment status, read from the API rather than inferred from the storefront.
Free30 minutesNo obligation
Saleor → GA4 · when not to buy
When you don't need this — Saleor → GA4
- Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the GA4 client_id.
- If you run a single storefront and no other clients, the added complexity of headless attribution buys you nothing over a standard integration.
- 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.
Saleor → GA4 · what we deliver
What gets built — Saleor → GA4
Identifier capture into Saleor
Capture in the storefront and write the identifier into order metadata through the API at checkout, so it lives on the order rather than in a session.
Event source: the Saleor order webhook
Send fully paid orders at their net total, sourced from the API.
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
Refunds and cancellations reverse.
Written guarantee
95%+ tracking accuracy
Measured against Saleor orders by payment status, read from the API rather than inferred from the storefront.. Miss it and we keep working at no cost.
From $400 · See packages
FAQ
Saleor → GA4 questions, answered
Write the client_id and session_id to checkout privateMetadata, then send purchase from the order-paid webhook with the Saleor order number as transaction_id.
They came from a client without a client_id, like an app or a storefront that never wrote one to metadata. Check the order's metadata.
Almost always because the GA4 client_id never reached the Saleor order. The storefront holds the browser session; the commerce API holds the order. Nothing carries between them unless the storefront puts it there. 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 Saleor order webhook. Send fully paid orders at their net total, sourced from the API.
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 Saleor → GA4
- Stripe → GA4Connecting Stripe to GA4
- PayPal → GA4Connecting PayPal to GA4
- HubSpot → GA4Connecting HubSpot to GA4
RELATED GUIDES
Where Saleor → GA4 fits in the rest of your tracking
- Ecwid → GA4Connecting Ecwid to GA4
- Squarespace → GA4Connecting Squarespace Commerce to GA4
- OpenCart → GA4Connecting OpenCart to GA4
- Saleor → PostHogConnecting Saleor to PostHog
- Saleor → MixpanelConnecting Saleor to Mixpanel
- Furniture ecommerceConversion tracking for furniture ecommerce, measured after delivery
- PrestaShop → GA4Connecting PrestaShop to GA4
- BigCommerce → GA4Connecting BigCommerce to GA4
Free · 30 min
Get Saleor and GA4 joined properly
Free30 minutesNo obligation
