# Installing Google Analytics 4 on a Shopify store

> On Shopify, adding Google Analytics 4 to theme.liquid is no longer enough to measure purchases. Since Shopify moved to its new checkout system (checkout extensibility), custom scripts can no longer be added to the payment and confirmation pages: the purchase event has to be covered another way.

- Source canonique : [https://allaux.fr/en/services/tracking/google-analytics-4-shopify](https://allaux.fr/en/services/tracking/google-analytics-4-shopify)
- Langue : EN
- Dernière mise à jour : 2026-09-30

## Direct answer

> In the Shopify admin, go through the Google & YouTube sales channel: theme.liquid no longer covers checkout or the confirmation page since additional scripts were removed from those pages. If the channel is not enough, create a custom pixel under Settings > Customer events. Then check a test order makes the purchase appear exactly once in DebugView.

## The situations I handle

- GA4 shows product page views but never a purchase event
- A tag installed in theme.liquid used to work and stopped reporting after a Shopify update
- You’re not sure whether to use the Google & YouTube sales channel or Custom Pixels
- An old pixel was migrated automatically by Shopify and you don’t know if it still works
- You want to check the GA4 install really covers the whole funnel, from catalogue to confirmation

## How I install GA4 on Shopify

1. **Assessing the legacy location** — theme.liquid still covers the catalogue, product pages and cart, but no longer the payment page or the order confirmation page since custom scripts were removed from those pages.
2. **Installing via the Google & YouTube channel** — Where possible, I connect GA4 through the official Google & YouTube sales channel in the Shopify admin, which handles reporting events including at the payment step.
3. **Alternative with a Custom Pixel** — In Settings > Customer events, I create a Custom Pixel that listens to Shopify events (page view, add to cart, order placed) and forwards them to GA4 from a sandboxed environment, separate from the theme code.
4. **Checking the purchase parameters** — I check that transaction_id (the Shopify order ID) and value match the amount actually paid, before calling the purchase event reliable.
5. **End-to-end testing** — I place a full test order, from catalogue to order status page, and check in GA4 DebugView that every event in the funnel is received.

## Why theme.liquid alone is no longer enough

Shopify has moved its checkout to what it calls checkout extensibility. One direct consequence: custom scripts added by hand to the payment and confirmation pages (the old Additional scripts mechanism, or checkout.liquid) are no longer rendered. Shopify announced a 28 August 2025 deadline for phasing out these legacy customisations.

In practice, a GA4 tag installed only in theme.liquid keeps measuring product pages and the cart, but loses the purchase event, the one that matters most for an online shop.

Since early 2025, Shopify has also automatically migrated old pixels that weren’t configured through the official sales channels into custom pixels, with Shopify itself flagging a risk of lost measurement while the migration is checked: I’d recommend checking this on any Shopify account that’s been running for several years.

## A quirk specific to Shopify

> On PrestaShop or WooCommerce, one code location is usually enough. On Shopify, since this change, you need to cover the main site and the payment step separately, through the Google & YouTube channel or a Custom Pixel, or you lose the purchase measurement.

## Related pages

- **Google Tag Manager on Shopify** — The same checkout constraint applies to GTM: how I cover it. ([/services/tracking/google-tag-manager-shopify](/services/tracking/google-tag-manager-shopify))
- **Ecommerce events that matter** — The GA4 events worth tracking first on a purchase funnel. ([/services/tracking/evenements-ecommerce-qui-comptent](/services/tracking/evenements-ecommerce-qui-comptent))
- **Gap between orders and your measurement tool** — Why a gap between real orders and measured conversions is normal, within limits. ([/services/tracking/ecart-commandes-boutique-outil-mesure](/services/tracking/ecart-commandes-boutique-outil-mesure))
- **Shopify, one of my platforms** — The other Shopify topics I deal with day to day. ([/shopify](/shopify))

## FAQ

### Why doesn’t my GA4 tag in theme.liquid measure purchases any more?

Since Shopify moved to its new checkout system, custom scripts no longer run on the payment and confirmation pages. theme.liquid alone no longer covers the purchase event.

### Should I use the Google & YouTube channel or a Custom Pixel?

The official sales channel is the simplest route when it covers what you need. A Custom Pixel gives more control over the events sent, useful when tracking needs fine-tuning.

### Does my old Shopify pixel still work?

Since early 2025, Shopify has automatically migrated old pixels not configured through the official channels. I always check a migrated pixel is still reporting correct data.

### Do I need consent before loading GA4 on Shopify?

GA4, in its standard configuration, doesn’t meet the CNIL’s exemption criteria. Loading it therefore, in principle, requires the visitor’s prior consent, as on any other platform.

### How do I check the whole funnel is tracked?

I place a full test order and check every event in GA4’s DebugView, from the catalogue through to the order status page.
