Shopify GA4 tracking: setup, purchases and gaps
Set up GA4 on Shopify with the Google & YouTube app, track purchases once, and understand why GA4 revenue rarely matches Shopify's own reports.
By DATALYR · · 3 min read
Contents
The supported way to add GA4
Shopify's recommended GA4 setup is the Google & YouTube sales channel: create a GA4 property and web data stream, install the channel, and connect the Google tag. Shopify notes you do not need to connect Merchant Center to finish the GA4 setup, and that certain ecommerce events are then tracked automatically.
Shopify also recommends its built-in integration over adding GA4 through Google Tag Manager, and warns that running both can duplicate tracking. Choose one path for GA4 and remove the other.
Check the setup before trusting it
Run through a short list after connecting. Most "GA4 not tracking purchases" reports come from one of these, not from a GA4 fault.
- The store is out of password-protected private mode. Shopify notes GA4 cannot track events until private mode is off.
- Only one GA4 purchase sender is active: the Google & YouTube app, or a GTM custom pixel, not both.
- Old gtag snippets are gone from theme.liquid and from any leftover checkout scripts.
- Your cookie banner is connected to Shopify's customer privacy settings, so consent reaches the pixel.
- A test order shows one purchase in GA4 DebugView with the order's transaction ID.
Fix duplicate GA4 transactions
Google Analytics deduplicates purchase events that share a transaction ID. Duplicates appear when two senders use different IDs for the same order, such as the order number in one tag and the numeric order ID in another.
Do not send an empty transaction ID. Google's ecommerce guide warns that GA4 will deduplicate all purchase events with an empty transaction_id, which merges unrelated orders into one.
To check, export a day of GA4 purchases with transaction IDs and match them to Shopify orders. Two GA4 rows for one order with different IDs means two senders. Fewer GA4 rows than orders with blank IDs means the empty-string problem.
Why GA4 and Shopify revenue differ
GA4 revenue comes from browser events. Shopify's reports come from orders. Any order the browser did not report is missing from GA4, and any refund or edit made later changes Shopify's figure without changing the purchase GA4 recorded.
Illustrative example. Shopify shows 500 orders for the month. GA4 shows 430 purchases. Of the 70-order gap, 40 came from visitors in a consent region who declined analytics, 20 were draft or point-of-sale orders that never passed through online checkout, and 10 had scripts blocked by the browser. 40 + 20 + 10 = 70.
Consent alone can explain a large share in Europe. Shopify notes that where a cookie banner applies, data is collected only after consent, which can lower session counts and conversion rates in analytics.
Explaining a 70-order gap (illustrative)
1. Shopify orders
500
Every paid order, from the order record.
2. Not seen by GA4
−70
40 consent declines, 20 non-web orders, 10 blocked scripts.
3. GA4 purchases
430
Browser-reported purchases only.
Use GA4 for behaviour, orders for money
GA4 is strong for site behaviour: landing pages, engagement, funnels and audiences. It is weaker as a revenue ledger for paid ads, because it cannot see orders the browser missed, and refunds reach it only if something sends them.
DATALYR reads revenue from Shopify transactions: gross is sales and captures, refunds are subtracted, and paid orders are counted from the order webhook. Each order is linked to the visit and ad click that preceded it, so revenue by campaign comes from the order record. DATALYR also honours Global Privacy Control by default, which is one reason its visitor count can sit below GA4's.
Related articles.
Commerce ·
Google Tag Manager on Shopify: custom pixel setup
How Google Tag Manager runs on Shopify today: as a custom pixel in Customer events, fed by Shopify events, with checkout coverage and no duplicate tags.
Commerce ·
Shopify conversion tracking: reconcile orders, refunds and ad delivery
Verify Shopify order capture, campaign identity, transaction revenue and destination delivery without counting the same purchase more than once.
Attribution ·
Revenue attribution: connect campaigns to actual payments
Follow a worked customer journey from campaign click to payment, then check revenue definitions, refunds, identity gaps, and attribution rules.
