Setting up Google Analytics 4 on Shopify incorrectly is surprisingly common - and the consequence is either missing data, duplicate event tracking, or both. The method that worked two years ago (adding a GA4 snippet directly to your theme) is now the wrong approach on modern Shopify stores. Here's how to do it correctly.
The correct method: Shopify Customer Events
Shopify introduced Customer Events (formerly called Pixels) as the official way to manage tracking on Shopify stores. It's a sandboxed JavaScript environment that fires tracking events from Shopify's checkout - including the purchase confirmation page, which themes can't access directly.
The key reason to use Customer Events rather than a theme snippet: it tracks checkout conversions accurately. Theme snippets can't fire on Shopify's hosted checkout pages, which means manual snippets miss purchase events - the most important data point in your analytics.
How to connect GA4 via Customer Events:
- In Shopify admin, go to Settings → Customer events
- Click "Add custom pixel"
- Name it "Google Analytics 4"
- In the code editor, add the GA4 event snippet (Shopify provides a template; your GA4 Measurement ID goes in the configuration)
- Set the privacy permissions to "Analytics" and save
Alternatively, use the Google & YouTube app from the Shopify App Store, which connects GA4 and Google Ads automatically through Customer Events without manual code. This is the simplest approach for most merchants and handles the main tracking events out of the box.
What to check after connecting
After connecting GA4, verify it's working before you rely on any data:
- Go to GA4 → Reports → Realtime. Open your Shopify store in another tab. Your session should appear in Realtime within 30 seconds.
- Place a test order on your store. Check GA4 Realtime for a "purchase" event with the correct order value.
- Check that you're not seeing duplicate page_view events - this happens when both a Customer Event pixel and a manual theme snippet are installed simultaneously. If you see two page_view events per page load, find and remove the duplicate.
The reports worth checking regularly
GA4 collects a huge amount of data. Most of it you'll never need. These are the reports that tell you something actionable about your Shopify store:
Acquisition report (where your traffic comes from). Reports → Acquisition → Traffic acquisition. Shows your sessions by channel - organic search, paid search, social, email, direct. Which channels are growing? Which are declining? This tells you where to focus your marketing effort and where your SEO work is paying off.
Ecommerce purchases. Reports → Monetisation → Ecommerce purchases. Which products are being purchased, at what revenue? Which products are being added to cart but not purchased (high add-to-cart rate, low purchase rate - a product page problem)? This is your most direct data on what's selling and what isn't.
Funnel exploration. Explore → Funnel exploration. Build a funnel: session → product page viewed → add to cart → checkout started → purchase. The drop-off at each step tells you where you're losing customers. A 40% drop between "add to cart" and "checkout started" is a cart problem. A 60% drop between "checkout started" and "purchase" is a checkout problem.
Landing pages. Reports → Engagement → Landing page. Which pages are customers arriving on from search? Which landing pages have the highest and lowest conversion rates? A page with high organic traffic but low conversion rate is either attracting the wrong audience or has a conversion problem worth investigating.
Common GA4 mistakes on Shopify
Tracking your own visits. If you browse your store while working on it, you're polluting your data with non-customer traffic. Filter your IP address out of GA4 data (Admin → Data Streams → your stream → Configure tag settings → Define internal traffic). This requires your office or home IP to be static, but it's worth the setup for cleaner data.
Not connecting Google Search Console. GA4 can show you which Google search queries are driving traffic to your store when linked to Google Search Console. Go to Admin → Product links → Search Console links and connect your GSC property. Once linked, you can see organic search performance data directly in GA4.
Comparing month-over-month without accounting for seasonality. A 30% traffic drop in January vs December doesn't mean your SEO is broken - it means it's January. Compare year-over-year for meaningful trend data, and use GA4's comparison features to see the same period last year.
Ignoring the data for months after setup. GA4 is only valuable if you check it. Set a recurring monthly time - 30 minutes - to review your acquisition sources, top-performing pages, and conversion funnel. Data without review is just storage.