Key takeaways
- Use one installation method only: the Google & YouTube app, a custom pixel, or GTM. Two methods running together is the top cause of doubled revenue.
- Every purchase event needs
transaction_id,value,currencyanditems. - Checkout tracking now runs through Shopify Customer Events. Old checkout scripts no longer fire.
- In Quebec, wire your consent banner to Consent Mode v2 before you go live.
- Test with DebugView and a real order, then compare GA4 with Shopify every week for the first month.

Three ways to install GA4 on Shopify
You can install GA4 on Shopify with the Google & YouTube app, with a custom pixel in Customer Events, or with Google Tag Manager. Choose one based on how much control you need, and run only that one.
Google & YouTube app
Shopify’s official app connects your GA4 property and sends standard ecommerce events, including purchases from checkout. It takes minutes and Shopify maintains it. The trade-off: you can’t add custom events or change parameters. See Shopify’s Google Analytics help page.
Custom pixel (Customer Events)
In Settings › Customer events, you write code that subscribes to Shopify events such as product_viewed or checkout_completed and sends them to GA4. It runs on checkout pages too. It runs in a sandbox, so it can’t read or change the page itself. See Shopify’s custom pixel documentation.
Google Tag Manager
GTM in the theme gives full control on storefront pages, but it does not run on checkout. Most GTM setups on Shopify now combine GTM in the theme with a custom pixel for checkout events, or load GTM inside a custom pixel. Both work, but they take more care to test.
| Method | Checkout events | Control | Best for |
|---|---|---|---|
| Google & YouTube app | Yes, built in | Low: standard events only | Smaller stores that want a reliable baseline fast |
| Custom pixel | Yes | High on event data, none on the page | Stores that need custom parameters or their own consent logic |
| GTM in the theme | No, needs a pixel for checkout | High on storefront pages | Teams already running many tags in GTM |
| Server-side tagging | Yes, via a pixel or webhooks | Highest | Larger stores with ad spend that depends on clean conversion data |
Server-side tagging sits on top of one of these methods. We cover it in our guide to server-side tracking on Shopify.
The ecommerce events that matter
Four events cover the core funnel: view_item, add_to_cart, begin_checkout and purchase. Each needs the right parameters, or GA4’s ecommerce reports stay empty.
view_itemfires on a product page. Sendcurrency,valueand anitemsarray with the product.add_to_cartfires when a product is added to the cart, with the quantity added.begin_checkoutfires when checkout starts, with every item in the cart.purchasefires once per order, on the thank you page.
For purchase, four parameters are essential. transaction_id is the order ID and must be unique. value is the order amount as a number. currency is a three-letter ISO code like CAD or USD, required whenever you send value. items lists each product with at least item_id or item_name, plus price and quantity. Add tax, shipping and coupon when you have them. Google’s full reference is in the GA4 ecommerce developer guide.
Decide once whether value includes tax and shipping, write it down, and keep it the same across GA4, Google Ads and your reports. Use the same ID format for item_id as your Google Merchant Center feed, so product reports line up.
Checkout Extensibility and its limits
Shopify’s checkout no longer accepts custom scripts. Under Checkout Extensibility, tracking on checkout, thank you and order status pages must go through Customer Events.
Shopify has retired checkout.liquid and the Additional scripts box. Any GA4 or Google Ads snippet pasted there stopped firing after the upgrade, which is why many stores lost purchase tracking without noticing. Three limits to keep in mind:
- Pixels run in a sandbox. They receive event data from Shopify, but they can’t read the page or the cookies of your theme.
- GTM preview mode and Tag Assistant may not connect to tags loaded inside a custom pixel. Plan to test with GA4 DebugView instead.
- Accelerated checkouts and third-party payment pages can behave differently. Test each payment method you offer.
Shopify updates these rules regularly. Check the current behavior in Shopify’s documentation before you build.
Avoiding duplicate purchases
Duplicate purchases come from two sources sending the same order, or from the thank you page firing again on reload. The fix is one source per event and a stable transaction_id.
Before you install anything, search your theme code for gtag( and G- IDs, and check Customer events for old app pixels. Remove every GA4 source except the one you chose. If you move from the Google & YouTube app to a custom pixel, disconnect GA4 in the app first.
GA4 can drop repeat purchases that share a transaction_id, but don’t rely on it to clean up a double setup. To check, build an exploration with Transaction ID and the Ecommerce purchases metric. Any ID with more than one purchase is a duplicate.
Consent Mode v2 and Law 25
In Quebec, Law 25 requires consent before you use technology that identifies, locates or profiles visitors. In practice, GA4 and ad tags should wait for consent, and Consent Mode v2 is how you pass that choice to Google tags.
Consent Mode v2 uses four signals: analytics_storage, ad_storage, ad_user_data and ad_personalization. Set them to denied by default for Quebec visitors, then update them when the visitor accepts. Shopify’s Customer Privacy API shares the visitor’s choice with pixels, and Shopify’s own app reads it. If you use another consent platform, confirm it updates both Shopify’s API and Google’s consent signals. See Google’s consent mode guide.
Expect GA4 to show fewer users and purchases once consent is enforced. That is the cost of compliance, not a bug. This article is not legal advice. For your specific obligations, see the Commission d’accès à l’information or a lawyer.
GA4 settings to change on day one
A few admin settings decide whether your data is usable later. Change them before you collect traffic, because most of them don’t apply to past data.
- Time zone and currency. Match your Shopify store settings, or daily totals won’t line up.
- Data retention. The default is 2 months for event-level data in explorations. On a standard property, raise it to 14 months. Standard reports are not affected. See Google’s data retention help page.
- Internal traffic. Define your office and team IP addresses in the data stream’s tag settings, then switch the Internal traffic filter from Testing to Active. See Google’s internal traffic guide.
- Unwanted referrals. Add payment domains such as PayPal so returning buyers don’t show up as referral traffic.
- Key events. GA4 now calls conversions “key events.”
purchaseis a key event by default. Mark only the events you actually act on. - Google Ads link. Link GA4 to Google Ads, then import the key events you want. Choose either the imported GA4 purchase or the Google Ads tag purchase as primary, never both.
Step-by-step setup
Here is the order we follow for a clean GA4 setup on Shopify. Each step depends on the one before it.
- Create a GA4 property and a web data stream for your store domain. Set the time zone and currency to match Shopify.
- Audit and remove old tracking: theme code, old apps and old pixels in Customer events.
- Set up your consent banner and Consent Mode v2 defaults, and confirm the Customer Privacy API receives the choice.
- Install GA4 with your chosen method: the Google & YouTube app, a custom pixel, or GTM plus a checkout pixel.
- Map the four ecommerce events with all required parameters.
- Change the admin settings above: retention, internal traffic, unwanted referrals, key events.
- Link Google Ads and set one primary purchase conversion.
- Test every event, place real orders, then compare GA4 with Shopify for four weeks.
Testing and QA
Test with GA4 DebugView and Tag Assistant before you trust any report. Standard reports can take a day or more to process, so a missing number on day one proves nothing.
DebugView shows events from browsers in debug mode within seconds. Turn it on with Tag Assistant or a debug_mode parameter. See Google’s DebugView help page. For checkout events from a custom pixel, place a real order with a discount code or refund it afterwards.
| QA check | Expected result | Where to inspect |
|---|---|---|
| view_item on a product page | One event with currency, value and the right item_id | DebugView |
| add_to_cart | One event per add, correct quantity | DebugView |
| begin_checkout | All cart items listed | DebugView |
| purchase | One event, transaction_id equals the Shopify order number | DebugView + Shopify order |
| Thank you page reload | No second purchase | DebugView + exploration by transaction ID |
| Consent refused | No analytics or ad cookies set; signals show denied | Tag Assistant + browser storage |
| Each payment method | Purchase recorded for card, PayPal, Shop Pay and others you offer | DebugView |
| Internal traffic | Team visits excluded once the filter is active | Realtime report |
Reconciling GA4 and Shopify revenue
GA4 will not match Shopify exactly, and it shouldn’t be expected to. Shopify is your financial record. GA4 measures sessions where the tag fired and consent allowed it.
Compare the same date range, the same time zone and the same definition of revenue. Then list the known causes of the gap: refused consent, ad blockers, POS and draft orders, subscription renewals, refunds, and orders paid in another currency. What matters is a stable gap you can explain. If the gap moves suddenly, check for a theme change, a new app or a broken pixel. GA4 showing more purchases than Shopify almost always means duplicates.
Common mistakes
- Running the Google & YouTube app and a custom pixel or GTM at the same time.
- Leaving old
gtagcode intheme.liquidafter switching methods. - Sending
valuewithoutcurrency, or sending it as text. - Using a random or session-based value as
transaction_id. - Keeping data retention at 2 months.
- Counting both GA4 and Google Ads tag purchases as primary conversions.
- Firing tags before consent for Quebec visitors.
- Judging the setup from standard reports on day one instead of DebugView.
Want a second pair of eyes on your tracking? Our Data service covers GA4, consent and server-side setups for Shopify stores. Book a free 30-minute call and we’ll look at your setup with you.
Sources
Frequently asked questions
Is Shopify’s Google & YouTube app enough for GA4?
For many stores, yes. It connects a GA4 property and sends the main ecommerce events, including purchases from checkout. If you need custom events, extra parameters or a specific consent setup, a custom pixel or Google Tag Manager gives you more control.
Can I still add GA4 code to the Shopify checkout or thank you page?
Not with the old methods. Shopify has retired checkout.liquid and the Additional scripts box as part of Checkout Extensibility. Tracking on checkout pages now runs through Customer Events: Shopify’s app pixels or a custom pixel.
Why does GA4 show less revenue than Shopify?
GA4 only sees purchases where the tag fired and consent allowed it. Ad blockers, refused consent, POS and draft orders, subscription renewals, refunds and different definitions of value (tax, shipping, discounts) all create a gap. A stable, explained gap is normal.
Should I import GA4 purchases into Google Ads or use the Google Ads tag?
Pick one as the primary purchase conversion for bidding and keep the other secondary. Counting both as primary doubles your conversions and misleads Smart Bidding.
Does Quebec’s Law 25 require consent before GA4 tracks visitors?
Law 25 requires consent before using technology that identifies, locates or profiles a person, and analytics and advertising cookies usually fall in that scope. Use a consent banner wired to Consent Mode v2, and check your setup with your legal advisor.

