# Installing Google Tag Manager on a Shopify store

> On Shopify, installing the Google Tag Manager container in theme.liquid no longer covers the whole measurement. Since Shopify moved to its new checkout system, the payment step has to be handled separately through Custom Pixels, in Settings > Customer events.

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

## Direct answer

> Add both container snippets to theme.liquid via Online Store > Themes > Edit code: that covers the catalogue, product pages and cart, but no longer checkout. For the purchase itself, add a custom pixel under Settings > Customer events. GTM Preview mode will show nothing firing on checkout until that second mechanism is in place.

## The situations I handle

- GTM is installed in theme.liquid but no tag fires on the payment page
- You’re not sure if the container is enough on its own or if a Custom Pixel is also needed
- A tag used to work before a Shopify update and stopped reporting since
- You’re migrating from another platform and assume one code location is enough, like elsewhere
- You want to centralise GA4, Ads and Meta through GTM while still covering purchases

## How I install GTM on Shopify

1. **Installing the container in theme.liquid** — I place both GTM code snippets (head and body) in theme.liquid, which covers the catalogue, product pages and cart.
2. **Assessing the payment page** — Since custom scripts were removed from the payment and confirmation pages, the code placed in theme.liquid no longer loads there: a second mechanism is needed.
3. **Creating a Custom Pixel** — In Settings > Customer events, I create a Custom Pixel that listens to Shopify events (order placed, add to cart). That pixel runs inside a sandboxed iframe with no access to the parent window, so it cannot push into the theme's window.dataLayer. I load a GTM instance inside the pixel itself, with its own data layer, and that instance fires the checkout-step tags.
4. **Matching the data layer across theme and pixel** — I match the variables (items, value, currency, transaction_id) between what theme.liquid sends and what the Custom Pixel sends, so both GTM instances, the theme's and the pixel's, report consistent data.
5. **End-to-end testing** — I place a full test order and check in GTM preview mode that tags fire correctly both on the catalogue and on the order confirmation.

## A quirk specific to Shopify

On PrestaShop or WooCommerce, a single code location in the theme is usually enough to cover the whole purchase funnel, including order confirmation. On Shopify, that’s no longer the case since the move to checkout extensibility: Shopify removed the ability to add custom scripts to the payment and confirmation pages, with a 28 August 2025 deadline announced for phasing out legacy customisations.

In practice, a GTM container installed only in theme.liquid keeps covering the catalogue and cart, but loses all visibility on the payment step. That step needs handling separately, through a Custom Pixel in Settings > Customer events, or through the official sales channels depending on the end tool.

Since early 2025, Shopify has also automatically migrated old pixels not configured through the official channels into custom pixels, with Shopify itself flagging a risk of lost measurement while the migration is checked.

## Two locations to manage, not one

> Unlike PrestaShop or WooCommerce, a full GTM install on Shopify needs to cover both theme.liquid for the main site and a Custom Pixel for the payment step. Missing the second one loses the purchase measurement.

## Related pages

- **Google Analytics 4 on Shopify** — The same checkout constraint applies directly to the GA4 tag. ([/services/tracking/google-analytics-4-shopify](/services/tracking/google-analytics-4-shopify))
- **Duplicate stats: the causes** — What happens when an official pixel and a Custom Pixel coexist for the same tool. ([/services/tracking/doublons-statistiques-causes](/services/tracking/doublons-statistiques-causes))
- **Gap between orders and your measurement tool** — Why a gap between real orders and measured conversions stays 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

### Is the GTM container in theme.liquid enough on Shopify?

No, not since the move to the new checkout system. theme.liquid covers the catalogue and cart, but no longer the payment page or order confirmation.

### What is a Custom Pixel?

A Shopify feature, in Settings > Customer events, that listens to site events from a sandboxed environment and lets you send tracking data even on payment pages where the theme code no longer runs.

### Why did my tag used to work and not any more?

Shopify stopped rendering custom scripts on the payment and confirmation pages, with a 28 August 2025 deadline announced. A tag installed only in theme.liquid stopped covering those pages from that point.

### Does a pixel automatically migrated by Shopify still work?

Since early 2025, Shopify has automatically migrated old pixels not configured through the official channels, with a risk of lost measurement while the migration is checked. I always check this on older Shopify accounts.

### Do I need consent before GTM fires tags on Shopify?

Tags fired by GTM, GA4 in particular, don’t meet the CNIL’s exemption criteria in their standard configuration and therefore, in principle, require the visitor’s prior consent, as on any other platform.
