Connecting Shopify to GA4
Shopify is the system of record for the order, and its admin numbers are the ones the business runs on. 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 Shopify 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
Shopify to GA4: purchase from orders/paid with the right client_id
To send Shopify purchases to GA4 from the server, write the _ga client_id and session_id to cart attributes, then on orders/paid send purchase through Measurement Protocol with transaction_id as the order ID and items from line items. Decide whether value includes shipping and tax, turn off the Google & YouTube app's purchase, and send refunds likewise.
Most Shopify stores send GA4's purchase through the Google & YouTube app, which fires from the checkout's web pixel. It misses draft orders, POS sales and anyone whose thank-you page never loads, and on stores that also add GA4 through GTM or a theme snippet it is common to find two purchase events per order.
To send from the server, capture the _ga client_id and the session_id from the property's session cookie on the storefront and write them to cart attributes, so they become note attributes on the order. On orders/paid, send purchase via Measurement Protocol with transaction_id set to the order ID, items built from the line items, and value matching the figure you chose to report; decide deliberately whether GA4 revenue includes shipping and tax, because Shopify's order total does. Then turn off the app's purchase event, since GA4 won't reliably reconcile the two.
POS and draft orders have no client_id at all. Leave them out of GA4 or send them with a clear marker, rather than letting them pile up under (direct)/(none). For refunds, refunds/create carries the order reference, so GA4's refund event can be sent with the same transaction_id and only the refunded items.
Shopify → GA4 · what breaks
Why this join usually fails — Shopify → GA4
- 01
The GA4 client_id never reaches Shopify
Shopify's checkout is locked down. Custom scripts on the checkout steps are not permitted on standard plans, and the old additional-scripts route is gone, so the identifier has to be captured on the storefront and carried into the order through cart or order attributes rather than read at the checkout itself.
- 02
Checkout extensibility hides what you need
Shopify deliberately restricts what runs during checkout. Setups that assumed free rein there broke when the platform moved to Checkout Extensibility, and many stores have been quietly under-reporting since.
- 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.
Shopify → GA4 · the fix
What working looks like — Shopify → 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
Shopify → GA4 · architecture
How Shopify and GA4 actually connect
- 1
Shopify holds the truth
The order carries line items, discounts, shipping, tax, currency and the customer. Note which figure you intend to report — total, subtotal, or net of shipping and tax — because most mismatches between Shopify and an ad platform turn out to be two people comparing two different numbers.
- 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 Shopify order.
- 4
The event source decides reliability
Send when Shopify says the order is paid, from your server. This also covers draft orders, POS, and the customer who closes the tab on the thank-you page — none of which a pixel on the order-status page will ever see.
- 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.
Shopify → GA4 · normal or broken
Working vs. broken, side by side — Shopify → GA4
Normal, not a fault
The GA4 client_id present on the order
Sent from the orders/paid 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
Shopify's checkout is locked down. Custom scripts on the checkout steps are not permitted on standard plans, and the old additional-scripts route is gone, so the identifier has to be captured on the storefront and carried into the order through cart or order attributes rather than read at the checkout itself.
Sent from the browser
Shopify deliberately restricts what runs during checkout. Setups that assumed free rein there broke when the platform moved to Checkout Extensibility, and many stores have been quietly under-reporting since.
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
Shopify → GA4 · diagnose
Diagnostic order — Shopify → GA4
- 01
Count orders carrying the GA4 client_id
- 02
Follow one real conversion end to end
- 03
Open a recent paid order and read its note attributes
If the identifier is not on the order, nothing downstream can attribute it. Check ten orders, not one — partial coverage is the normal failure, not total absence.
- 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.
Shopify → GA4 · prove
How it gets proven — Shopify → GA4
Source of truth
Shopify Admin → Orders, for the same window, in the same currency and on the same timezone.
- 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 totals in Shopify Admin reconciled per order, not on the summed total, over a closed window.
Shopify → GA4 · free audit
What we check in the free audit
- Count orders carrying the GA4 client_id
- Follow one real conversion end to end
- Open a recent paid order and read its note attributes
- Check whether server events carry a session and a source
- Read the match rate, not the success message
Checked against
Shopify Admin → Orders, for the same window, in the same currency and on the same timezone.
Free30 minutesNo obligation
Shopify → GA4 · when not to buy
When you don't need this — Shopify → GA4
- Measure identifier coverage yourself first — pull your last hundred orders and count how many carry the GA4 client_id.
- Shopify's own native channel integrations already cover simple single-currency stores adequately. If your admin numbers and platform numbers already agree, you do not need this.
- 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.
Shopify → GA4 · what we deliver
What gets built — Shopify → GA4
Identifier capture into Shopify
Capture the click identifier on the storefront, write it to a cart attribute so it becomes an order note attribute, and read it back server-side from the order. That path survives the checkout domain hop that breaks cookie-based approaches.
Event source: the orders/paid webhook
Send when Shopify says the order is paid, from your server. This also covers draft orders, POS, and the customer who closes the tab on the thank-you page — none of which a pixel on the order-status page will ever see.
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/create fires with the original order reference, so refunds and cancellations can be reversed at the destination.
Written guarantee
95%+ tracking accuracy
Measured against Shopify Admin → Orders, for the same window, in the same currency and on the same timezone.. Miss it and we keep working at no cost.
From $400 · See packages
FAQ
Shopify → GA4 questions, answered
The browser purchase misses draft orders, POS and customers who never see the thank-you page. Sending purchase from orders/paid with the stored client_id closes most of the online gap.
Usually the Google & YouTube app and a GTM or theme tag both send purchase. Keep one sender rather than relying on GA4 to sort them out.
Almost always because the GA4 client_id never reached the Shopify order. Shopify's checkout is locked down. Custom scripts on the checkout steps are not permitted on standard plans, and the old additional-scripts route is gone, so the identifier has to be captured on the storefront and carried into the order through cart or order attributes rather than read at the checkout itself. 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 orders/paid webhook. Send when Shopify says the order is paid, from your server. This also covers draft orders, POS, and the customer who closes the tab on the thank-you page — none of which a pixel on the order-status page will ever see.
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 Shopify → GA4
- Shopify POS → GA4Connecting Shopify POS to GA4
- Checkout Extensibility → GA4Connecting Shopify Checkout Extensibility to GA4
- GA4 and Shopify revenue mismatchWhy don't GA4 and Shopify revenue match?
RELATED GUIDES
Where Shopify → GA4 fits in the rest of your tracking
- PrestaShop → GA4Connecting PrestaShop to GA4
- Medusa → GA4Connecting Medusa to GA4
- nopCommerce → GA4Connecting nopCommerce to GA4
- Shopify → MatomoConnecting Shopify to Matomo
- Shopify → Adobe AnalyticsConnecting Shopify to Adobe Analytics
- FashionConversion tracking for fashion brands, reported net of returns
- SureCart → GA4Connecting SureCart to GA4
- Wix → GA4Connecting Wix Stores to GA4
Free · 30 min
Get Shopify and GA4 joined properly
Free30 minutesNo obligation
