Key takeaways
- The simplest reliable setup is Shopify's Google & YouTube app, which sends GA4 ecommerce events automatically.
- Don't also paste the GA4 tag into your theme — that is the most common cause of double-counted page views and sales.
- Purchase tracking works through Shopify's customer events, as scripts can no longer be added to checkout pages.
- Set up consent so GA4 respects visitors' cookie choices, especially for UK and EU shoppers.
- Test with GA4's DebugView and a real order before trusting the numbers.
Google Analytics 4 (GA4) tells you where visitors come from, what they look at and where they drop off. On Shopify, the hard part is not installing it — it is installing it once, correctly, so purchases and revenue match what actually happened.
Before you start
- Create a GA4 property and a web data stream for your store's domain.
- Make sure you have admin access to the property and to Shopify.
- Remove any old Universal Analytics or GA4 code from your theme to avoid duplicates.
Step 1: Install the Google & YouTube app
In Shopify, add Google's sales channel app (Google & YouTube) and connect the Google account that owns your GA4 property. The app links Google Merchant Center and Google Ads too, so it is worth setting up even if you start with analytics alone.
Step 2: Connect your GA4 property
In the app's settings, choose your GA4 property. Shopify then sends standard ecommerce events — page_view, view_item, add_to_cart, begin_checkout and purchase — with product and revenue details, without any code in your theme.
Step 3: Set up consent
If you sell to the UK or EU, analytics cookies need consent. Turn on Shopify's cookie banner (or a consent app built on Shopify's Customer Privacy API) so GA4 receives visitors' choices through Google's consent mode. Without it, you risk both non-compliance and unreliable data.
Step 4: Test before you trust
- Use DebugView: Open GA4 DebugView, browse your store and check that each event arrives once.
- Place a real order: Buy a low-priced product and refund it. The purchase should appear with the right value and currency.
- Compare with Shopify: After a few days, compare GA4's revenue with Shopify's sales report. Expect small gaps from consent and ad blockers; large gaps mean a setup problem.
Common mistakes
- Double tracking: The app plus a hard-coded tag in the theme counts everything twice. Use one method.
- Old checkout scripts: Code that used to live in
checkout.liquidor the order status page no longer runs. Purchases are tracked through customer events instead. - Wrong currency: Multi-currency stores should check that revenue is reported in the expected currency.
- Ignoring cross-domain traffic: If you send shoppers to a separate domain for bookings or quotes, configure cross-domain measurement.
Reports worth setting up
- A funnel exploration from product view to purchase, split by device.
- Traffic acquisition by channel with ecommerce revenue.
- Landing page performance for your ads and SEO pages.
Frequently asked questions
Does Shopify support GA4?
Yes. Shopify connects to GA4 through Google's sales channel app, which sends ecommerce events automatically.
Why doesn't GA4 revenue match Shopify?
Small gaps come from consent choices, ad blockers and refunds. Large gaps usually mean double tracking or a broken setup.
Can I add GA4 code to the Shopify checkout?
Not directly. Scripts can no longer be added to checkout pages; purchases are tracked through Shopify's customer events instead.
Analytics is the foundation of every test and campaign. Our digital marketing team checks tracking first on every account, because decisions are only as good as the data behind them.
Filed under
Jay Patel