DEV Community

Cover image for Set Up GA4 on Shopify Free, and Read It Correctly
Luke Sandelands
Luke Sandelands

Posted on Edited on Originally published at stackarchitect.xyz

Set Up GA4 on Shopify Free, and Read It Correctly

Google Analytics 4 connects to Shopify free through the Google & YouTube app: install it, choose the Google Analytics 4 setup on its Overview page, and connect your GA4 property. Shopify then sends standard ecommerce events, including purchases. Never add a GA4 tag to your theme too, and treat Shopify's order count, not GA4's, as the true number of sales.

Questions this guide answers

How do I connect Google Analytics 4 to Shopify?

Create a GA4 property with a web data stream, then install Shopify's Google & YouTube app. On the app's Overview page, find the section for setting up Google Analytics 4 only, click Get started, choose your property under your Google account, click Connect and then Confirm. Google documents these steps in its help article Shopify: Set up your Google tag.

Do I need Google Tag Manager to use GA4 on Shopify?

No. The Google & YouTube app sends Shopify's standard ecommerce events to GA4 without Google Tag Manager. If you add GA4 through Tag Manager, a theme snippet or a custom pixel as well, the same visit and purchase can be recorded twice, so use one method only.

Why does GA4 show fewer purchases than Shopify?

Shopify records every order on its own servers. GA4 only records a purchase if the tag in the shopper's browser runs, and ad blockers, declined cookie consent and browser privacy limits all stop it. A gap is expected. Use Shopify's order count as the true figure and use GA4 for what it is good at: where visitors come from and where they leave.

Should I send Shopify purchases to GA4 through the Measurement Protocol?

Usually not. Google's Measurement Protocol documentation says the client_id should match the ID generated by the Google Analytics tag on your site, which a Shopify order webhook does not contain. Sending purchases with another ID, such as the customer number, creates purchases with no traffic source and risks counting orders twice alongside the browser tag.

Is GA4 free for Shopify stores?

Yes. The standard version of Google Analytics 4 is free, and so is Shopify's Google & YouTube app. The paid version, Google Analytics 360, is aimed at very large sites and is not needed by a typical Shopify store.


The full guide, with every step, source and date: Set Up GA4 on Shopify Free, and Read It Correctly

Originally published on Stack Architect by Luke Sandelands. Figures there carry the date they were last checked; this copy does not, so prefer the original.

Top comments (1)

Collapse
 
omyvnss profile image
Om Yaduvanshi •

the silently-discarded event gotcha deserves its own headline. ga4 returning 2xx on a request it will never show you is the kind of thing that eats an afternoon and produces a fun support thread. the /debug/mp/collect note is the save here; most writeups mention the endpoint exists and never tell you when to use it.

one thing i would push back on slightly: the small overcount line is fine until someone wires that same purchase stream into ads optimisation or a p&l. the overcount stops being small the moment money math touches it. worth having a dedupe strategy even if ga4 does not give you one for free.