Skip to main content
Saleor → GA4Integration guide

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

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

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

  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.

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. 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. 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 Saleor order.

  4. 4

    The event source decides reliability

    Send fully paid orders at their net total, sourced from the API.

  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.

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

  1. 01

    Count orders carrying the GA4 client_id

  2. 02

    Follow one real conversion end to end

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

  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.

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.

Get my free conversion tracking audit

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.

Get my free conversion tracking audit

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.

Free · 30 min

Get Saleor and GA4 joined properly

Free30 minutesNo obligation