GA4 on Shopify looks simple: install an app, connect a property, done. Then the numbers come in and they don’t match your orders, purchases are missing or counted twice, and nobody can say whether consent is working. This guide puts everything in one place: how Shopify sends data today, the setup methods, what to track, consent, server-side, how to prove the data is right, and the setup I recommend for each store size.
Each section links to a deeper guide if you need the details.
How data leaves a Shopify store today
Most GA4 tutorials written before 2024 no longer work, because Shopify changed where tracking code is allowed to run.
- The theme (home, collections, product pages, cart) still accepts scripts in
theme.liquid, but scripts there can’t see the checkout. - The checkout and thank-you pages no longer accept scripts.
checkout.liquidand the Additional scripts box have been retired, for Plus and non-Plus stores alike. - Customer events (Settings → Customer events) are now the official way to track. Shopify publishes standard events such as
product_viewedorcheckout_completed, and pixels subscribe to them on every page, checkout included. - Pixels run in a sandbox. They receive event data but can’t read or change the page. This is the source of most “it worked on my old store” problems.
I explain the model in detail in how Shopify Customer Events work, and the checkout specifics in how to track Shopify checkout inside the pixel sandbox.
The three ways to set up GA4
| Google & YouTube app | GTM in a custom pixel | Tracking app | |
|---|---|---|---|
| Cost | Free | Free tools, setup time | Monthly subscription |
| Setup time | Minutes | Days, with testing | Hours |
| Custom events and parameters | No | Yes | Some |
| Feeds other platforms | Google only | All, from one data layer | Depends on the app |
| Debugging | Limited | Full, with some sandbox constraints | App dashboards |
| Who owns the setup | Shopify and Google | You | The app vendor |
Step-by-step instructions for each are in Shopify GA4 setup in 2026. If you choose GTM, the full copy-paste code is in building a full ecommerce dataLayer from a Shopify custom pixel, and every way to install GTM itself is compared in how to set up Google Tag Manager on Shopify.
What to track
The ecommerce funnel
GA4’s ecommerce reports need the recommended events, in GA4’s format, with items:
view_item_list,view_item,searchadd_to_cart,remove_from_cart,view_cartbegin_checkout,add_shipping_info,add_payment_infopurchase, with the Shopify order ID astransaction_id
Every event that carries products should send the same item_id convention (SKU, product ID or variant ID). Mixing them breaks product reports and Google Ads dynamic remarketing.
Custom dimensions worth adding
- Customer type (new or returning) on the purchase, so you can split acquisition from retention.
- Discount code as
coupon, to measure promotions. - Page type (home, collection, product, cart, checkout step), for clean funnel explorations.
- Logged-in status, if accounts matter to your business.
Register each one in GA4 (Admin → Custom definitions), otherwise it is collected but invisible in reports.
What not to track
Don’t send email addresses, names or phone numbers to GA4: Google’s terms forbid personal data in GA4. Customer data belongs in Google Ads enhanced conversions and Meta’s Conversions API, with consent.
Consent
In the EU and UK, GA4 has to respect the visitor’s choice. On Shopify, the clean path is: your cookie banner writes the choice to Shopify’s Customer Privacy API, and your tags read it from there, in the theme and in pixels. Google’s Consent Mode v2 then tells GA4 and Google Ads what they are allowed to do.
Two decisions matter:
- Basic or advanced Consent Mode. Basic sends nothing until consent. Advanced sends cookieless pings, which lets Google model part of the lost conversions. Your legal team should validate advanced mode.
- The pixel’s permission setting. If a custom pixel requires analytics or marketing consent, Shopify doesn’t load it at all before consent, so advanced Consent Mode can’t work from that pixel.
The full setup is in Consent Mode v2 on Shopify with the Customer Privacy API, and you can test your banner in five minutes with this cookie banner test.
Server-side tracking: when it’s worth it
For GA4 alone, server-side tracking is rarely the first priority. It becomes worth it when you run paid ads on Meta, Google Ads or TikTok and want their conversions to be complete and well matched, or when you want one data stream feeding all platforms. It doesn’t bypass consent, and it doesn’t fix a broken data layer. Read Shopify server-side tracking: what it fixes, what it doesn’t, and what it costs before deciding.
GA4 settings to check
- Timezone and currency identical to Shopify (Settings → General).
- Data retention at 14 months, otherwise explorations lose history after two months.
- Unwanted referrals for payment providers (PayPal, Klarna, Shop Pay, 3-D Secure pages). See fixing paypal.com / referral.
- Internal traffic filtered, and test orders kept out of revenue.
- Purchase marked as a key event.
- Google Ads and Merchant Center linked, and BigQuery export switched on (free, and it keeps raw data GA4’s interface can’t show).
- One purchase source only. If the Google & YouTube app and a GTM tag both send purchases, GA4 counts orders twice. See duplicate purchase events.
Prove the data is right
GA4 will never match Shopify exactly: consent refusals, ad blockers and payment redirects all remove some purchases. What matters is knowing the gap and its causes. Export a week of Shopify orders, export GA4 purchases by transaction_id, and compare them order by order. A healthy setup usually captures the large majority of orders, with the missing ones explained by consent. If the gap is bigger, or growing, something is broken. The method is in why GA4 shows fewer purchases than Shopify.
The setup I recommend by store size
| Store | Recommended setup | Why |
|---|---|---|
| Starting out, no paid ads | Google & YouTube app, Shopify’s cookie banner, Shopify Analytics for sales | Free, quick, good enough to learn where traffic comes from |
| Growing, ads on one or two platforms | GTM in a custom pixel, Consent Mode v2, native apps or server-side for Meta and Google Ads | Control over events, one data layer, clean conversions for ads |
| Scaling, ads on several platforms | GTM custom pixel plus server-side GTM feeding GA4, Google Ads, Meta and TikTok | Complete, deduplicated conversions and one place to manage them |
| Multi-store or international | Server-side GTM, a measurement plan shared across stores, BigQuery export | Consistent data across markets and reporting beyond GA4’s interface |
Keep it working
Tracking breaks quietly. A new theme, a checkout app, a cookie banner update or a Shopify change can stop purchases from reaching GA4 without any visible error. Run a short QA after every change, and a full one every quarter. My 25-check Shopify tracking QA is the list I use.
The mistakes I see most often
- Two purchase sources at the same time (the app and GTM, or an old theme script and a pixel).
- GTM or gtag still hardcoded in
theme.liquid, ignoring the cookie banner. - Page URLs in GA4 showing the sandbox address instead of the real page, because the pixel reads the iframe’s location.
- Purchases landing in Direct or Unassigned because the visitor isn’t recognized at checkout. See Shopify purchases attributed to Direct or Unassigned.
- No referral exclusions, so PayPal gets credit for purchases.
- Currency or timezone different from Shopify, so daily numbers never line up.
- Nobody checks the data after launch.
Frequently asked questions
What is the best way to set up GA4 on Shopify?
For a small store without ads, the Google & YouTube app. For a store running ads on several platforms, Google Tag Manager in a custom pixel with Consent Mode v2, and server-side tracking for ad platforms.
Why doesn’t GA4 match Shopify revenue?
Consent refusals, ad blockers, payment redirects and setup problems remove some purchases, and GA4 and Shopify define revenue differently. Measure the gap by order ID rather than by totals.
Does GA4 track the Shopify checkout?
Yes, through Customer events: an app pixel or a custom pixel receives checkout_started through checkout_completed. Scripts in the theme can’t.
Do I need server-side tracking for GA4 on Shopify?
Not for GA4 alone in most cases. It matters more for ad platforms, and for keeping returning Safari visitors recognized through cookie restoration.
Need a hand?
If you’d rather have it set up and checked against your orders, my Starter package covers GA4 with GTM and Consent Mode v2 for 1,300€, and the Professional package (3,500€) adds server-side tracking for every ad platform. If you already have a setup and want to know if you can trust it, a tracking audit starts at 800€. See the Shopify tracking packages or book a free 30-minute call.