— CONVERSION TRACKING — NOV 22, 2026 —

Google Tag Manager on Shopify with Custom Pixels

If your Google Tag Manager setup on Shopify was built a few years ago, part of it has probably stopped working. Tracking code used to be pasted into the theme and into checkout's additional scripts box. Shopify has moved checkout tracking to pixels, and the old box is now view-only. This guide explains what changed, how to run Google Tag Manager as a Shopify custom pixel, which events to send, and the limitations you need to plan around before you trust the numbers.

Facts in this article come from Shopify's Help Centre tutorial on Google Tag Manager as a custom pixel, its pixels overview and its checkout upgrade guide, checked on 19 November 2026. Shopify and Google change their documentation often, so check the linked pages before acting on a detail.

Why did Google Tag Manager stop working on Shopify checkout?

Because the place it lived has been retired. Shopify's checkout upgrade guide says that as of 28 August 2025, the additional scripts section in checkout settings is view-only, and scripts there must be replaced on the new pages using built-in features, apps or custom pixels. For stores not on Shopify Plus, the deadline to upgrade existing Thank you and Order status pages was 26 August 2026.

In practice, many stores find that GTM still fires on the storefront, because the container is still in theme.liquid, but purchase and checkout events have gone missing or doubled. Our post on what to check after the checkout deadline covers the wider fallout.

What are Shopify custom pixels and customer events?

Shopify now handles tracking through pixels, managed in Settings > Customer events. There are two kinds:

  • App pixels, installed by marketing and analytics apps such as the Google & YouTube app or Meta's app.
  • Custom pixels, which a developer adds by hand in the pixels manager.

Pixels listen to customer events that Shopify publishes, such as a product being viewed, added to cart, or a checkout being completed. Shopify says custom pixels let you collect customer events on more pages of your store, including checkout, which theme code cannot reach. Pixels run in a sandbox for security, and Shopify notes that not all pixel functionality works inside it.

Timeline of where Shopify tracking scripts moved, from additional scripts to pixels
The container in your theme still works for storefront pages. Checkout tracking has to come from a pixel.

How do you set up Google Tag Manager as a Shopify custom pixel?

Shopify's Help Centre gives a step-by-step tutorial. In outline:

  1. In Google Tag Manager, go to Admin and choose Install Google Tag Manager to get the container code for the head.
  2. Remove the HTML <script> tags and keep the code inside them.
  3. In Shopify, go to Settings > Customer events, add a custom pixel, and paste the code.
  4. In the same pixel, subscribe to Shopify's customer events and push each one into the dataLayer.
  5. In GTM, create the triggers, dataLayer variables and tags that use those events. Shopify notes at least one tag and trigger are needed for data to transfer.
  6. Replace any old dataLayer.push calls in your theme with Shopify.analytics.publish(), so custom events also flow through the pixel.
  7. Test with the Shopify Pixel Helper.

The code below is illustrative only, to show the structure. Use Shopify's full example from the tutorial as your starting point, because it includes the exact field mapping for each event.

// Illustrative only, based on Shopify's GTM tutorial. Not a complete pixel.
// 1. Paste your GTM container code here, without the <script> tags.
window.dataLayer = window.dataLayer || [];

// 2. Push Shopify customer events into the dataLayer.
analytics.subscribe("product_added_to_cart", (event) => {
  window.dataLayer.push({
    event: "product_added_to_cart",
    // map the fields your GTM tags need from event.data
  });
});

analytics.subscribe("checkout_completed", (event) => {
  window.dataLayer.push({
    event: "checkout_completed",
    // map order ID, value and currency from event.data.checkout
  });
});

Which events should you send from the pixel?

Shopify's GTM example subscribes to 12 customer events, from page_viewed and product_viewed through checkout_started to checkout_completed. It also maps Shopify's standard event names to GA4's ecommerce names, for example:

Shopify customer event GA4 event
product_viewed view_item
collection_viewed view_item_list
product_added_to_cart add_to_cart
cart_viewed view_cart
checkout_started begin_checkout
checkout_address_info_submitted add_shipping_info
payment_info_submitted add_payment_info
checkout_completed purchase

Send only the events your tags actually use. Every extra event is something else to maintain. For most stores, the essentials are product views, add to cart, checkout started and purchase.

If you need data Shopify's standard events do not include, Shopify says you cannot add custom data to standard events. Publish your own custom event from Liquid with Shopify.analytics.publish() instead, and read it in the pixel from event.customData.

Shopify's GTM custom pixel example: 12 events, 8 GA4 mappings, 4 consent signals
Shopify's example is a full starting point. Trim it to the events your tags need.

What are the limitations of GTM in a custom pixel?

Plan around these before you promise anyone a perfect setup:

  • Sandbox restrictions. Shopify says tag managers in the sandbox face the same restrictions as other pixels. Tags that expect to read or change the page directly may not work.
  • Page URLs. To avoid sandbox details appearing in GA4 page URLs, Shopify's tutorial says to turn off GA4's automatic page tracking and push your own page_viewed event with the real page location and title.
  • Enhanced measurement. Some automatic GA4 events, such as outbound link clicks, cannot fire automatically. They have to be built as custom events.
  • Debugging tools. Shopify says Google Tag Assistant's troubleshoot feature is not compatible with custom pixels and does not detect Google tags inside them. Use the Shopify Pixel Helper and GA4's DebugView instead.
  • Duplicates. If the Google & YouTube app pixel already sends purchases to Google Ads, and your GTM pixel sends them too, you will double count. Decide which pixel owns which destination.
Google and YouTube app screen for setting up a Google tag from Shopify
The Google and YouTube app can set up a Google tag from inside Shopify, which covers many stores before Tag Manager is needed.
Photo: Google and YouTube app listing, apps.shopify.com/google

How do consent and privacy affect your pixel?

Shopify's pixels overview says new pixels require Marketing and Analytics permissions by default, and in markets that require consent, such as the EEA and the UK, pixels run only when visitors have given the permissions the pixel needs. Pixels marked as data sale do not run for customers who opted out, unless the pixel supports limited data use.

Shopify's GTM example includes a Google Consent Mode v2 update that sets four signals, ad_storage, analytics_storage, ad_user_data and ad_personalization, to granted. Shopify is clear that this example may not match your region's requirements and that compliance is your responsibility. For Indian stores, our guide to the DPDP Act for Shopify stores explains the consent questions to answer before you copy those settings.

It also helps to decide who owns tracking. On many stores the pixel was added by one agency, the GA4 property belongs to another, and the Meta setup was done by a freelancer who has since moved on. When a number looks wrong, nobody knows where to start. Write down which pixels are installed, who set each one up, which account they send data to, and who has access. Review that list whenever you change agencies or add an app that installs its own pixel, because two pixels sending the same purchase event is one of the most common reasons GA4 and ad platforms report more sales than Shopify.

Keep the custom pixel code itself in version control or at least in a shared document. Keeping a dated copy outside Shopify is the easiest way to see what changed when tracking breaks, and to restore a working version quickly. Add a short note each time you edit it: what changed, why, and who made the change. When a sale starts and the numbers suddenly look odd, that note is often the fastest route to the cause, and it saves an expensive afternoon of guessing between the theme, the pixel and the ad platform.

How do you check that tracking is correct?

  1. Open the store with the Shopify Pixel Helper and confirm your custom pixel loads and receives events.
  2. Watch GA4's DebugView while you browse, add to cart and place a test order.
  3. Compare a week of GA4 purchases with Shopify orders. They will not match exactly, but they should be close. Our guide to GA4 and Shopify numbers that do not match explains the normal gaps.
  4. Remove the old GTM container and any hard-coded tags from the theme once the pixel is proven, so nothing fires twice.

If you also run Meta ads, the same principle applies to the Meta pixel; our guide to Meta pixel and Conversions API on Shopify covers that side.

If you would rather have tracking set up and checked for you, our guide to a Shopify analytics setup that matters shows what a complete setup should include.

Not sure your tracking survived the checkout upgrade? Email hello@exactwhy.com with the subject "Pixel and GTM check" and your store URL. We will check which pixels are installed in Customer events, look for old tags still in your theme, test your add to cart and purchase events, and tell you what is missing or duplicated, free. If you want us to rebuild the setup, we quote after the check, and ongoing support is available on a monthly retainer. You can also reach us through our contact page. We reply within 4 hours.

Other Blogs

ENTERPRISE ECOMMERCE
Shopify Plus Support, What You Get and What You Do Not
Dec 05, 2026
Parth Sojitra
CRO
What a Free Shopify Store Audit Gives You Versus a Paid One
Dec 05, 2026
Parth Sojitra
CROSS-SELL
How to Set Up Related and Complementary Products on Shopify
Dec 05, 2026
Parth Sojitra
CASH ON DELIVERY
Should You Use a COD Order Form App on Shopify?
Dec 04, 2026
Parth Sojitra
CONTRACTS
Response and Fix Times to Agree With a Shopify Agency
Dec 04, 2026
Parth Sojitra
DAWN THEME
Shopify Horizon Theme, Should You Switch From Dawn?
Dec 04, 2026
Parth Sojitra
CCPA
Dark Patterns Rules in India and Your Shopify Store
Dec 03, 2026
Parth Sojitra
DPDP
Shopify Email Popups and First Order Discounts Done Right
Dec 03, 2026
Parth Sojitra
CONVERSION RATE OPTIMISATION
What a Shopify CRO Audit Should Include and What Drives Cost
Dec 03, 2026
Parth Sojitra
CLS
Shopify Speed Score vs PageSpeed, Which Number Matters?
Dec 02, 2026
Parth Sojitra
ECOMMERCE PLATFORM
Shopify vs Hostinger Website Builder for an Indian Brand
Dec 02, 2026
Parth Sojitra
INDIAN D2C
How to Transfer Shopify Store Ownership the Right Way
Dec 02, 2026
Parth Sojitra
COD
Shopify Referral Program for Indian D2C Brands That Works
Dec 01, 2026
Parth Sojitra
CASH ON DELIVERY
Shopify COD Fee in India and the Drip Pricing Rules
Dec 01, 2026
Parth Sojitra
CORE WEB VITALS
Shopify Speed Optimization Apps, Do They Actually Work?
Dec 01, 2026
Parth Sojitra
ACCESS TOKENS
Shopify Expiring Access Tokens for Custom Apps Explained
Nov 30, 2026
Parth Sojitra
INDIAN D2C
Shopify Cost After 3 Months in India, What You Really Pay
Nov 30, 2026
Parth Sojitra
INDIAN D2C
Are Shopify SEO Apps Worth Paying For in 2026?
Nov 30, 2026
Parth Sojitra
COLOUR SWATCHES
Shopify Colour Swatches and Variant Images, Set Up Properly
Nov 29, 2026
Parth Sojitra
D2C INDIA
Sell Live Plants Online in India on Shopify Without Losses
Nov 29, 2026
Parth Sojitra
D2C INDIA
Start an Eyewear Brand on Shopify in India the Right Way
Nov 29, 2026
Parth Sojitra
CUSTOMER SUPPORT
Product FAQs on Shopify That Cut Tickets and Help Buyers
Nov 28, 2026
Parth Sojitra
COD
Shopify Shipping Rates and Free Shipping Threshold in India
Nov 28, 2026
Parth Sojitra
AOV
Gift With Purchase on Shopify Without the Usual Headaches
Nov 28, 2026
Parth Sojitra
BFCM 2026
Shopify BFCM Live 2026, What the Global Numbers Tell You
Nov 27, 2026
Parth Sojitra
CLOSE SHOPIFY STORE
Pause or Close Your Shopify Store? What Happens to Your Data
Nov 27, 2026
Parth Sojitra
BLACK FRIDAY
Shopify Post-Sale Review, What to Check After Black Friday
Nov 27, 2026
Parth Sojitra
INDIAN D2C
Should You Put Your Shopify Store on a Password Page?
Nov 27, 2026
Parth Sojitra
FULFILMENT
Shopify Tracking Not Showing to Customers? How to Fix It
Nov 26, 2026
Parth Sojitra
COD
Stop Fake COD Orders and Spam Signups on Shopify
Nov 26, 2026
Parth Sojitra
CHECKOUT ERRORS
Is Shopify Down or Is It Your Store? What to Check First
Nov 26, 2026
Parth Sojitra
CHANNEL MAPPING
Shopify Channel Mapping for Google and Meta Product Data
Nov 25, 2026
Parth Sojitra
APP AUDIT
Shopify Year-End Checklist for Indian Stores in 2026
Nov 25, 2026
Parth Sojitra
AI SHOPPERS
Shopify SimGym AI Shoppers, What They Can Test
Nov 25, 2026
Parth Sojitra
CART PERMALINKS
Shopify Checkout Links for Instagram and WhatsApp Sales
Nov 24, 2026
Parth Sojitra
CHANGELOG
How to Use Shopify's New Partner Directory to Pick an Agency
Nov 24, 2026
Parth Sojitra
AD BUDGET
Shopify Campaign Autopilot Explained for Indian Brands
Nov 24, 2026
Parth Sojitra
APPAREL
Shopify Size Guides That Cut Apparel Size Returns
Nov 23, 2026
Parth Sojitra
ACCESSIBILITY
Sticky Add to Cart on Shopify Mobile, Done Properly
Nov 23, 2026
Parth Sojitra
CORE WEB VITALS
What Your Shopify Homepage Should Show in the First Screen
Nov 23, 2026
Parth Sojitra
CART DRAWER
Shopify Cart Drawer vs Cart Page, Which Should You Use
Nov 22, 2026
Parth Sojitra
GOOGLE ADS
Google Ads for a Shopify Store in India, Set Up Right
Nov 22, 2026
Parth Sojitra
BLOGGING
Does Your Shopify Store Need a Blog to Get Sales?
Nov 21, 2026
Parth Sojitra
GOOGLE MERCHANT CENTER
Shopify Product Schema for Google Rich Results Explained
Nov 21, 2026
Parth Sojitra
EMERGENCY SUPPORT
How to Contact Shopify Support From India, and When Not To
Nov 21, 2026
Parth Sojitra
BRAND LAUNCH
H.I.M by Ranveer Singh, Inside the Brand's Shopify Store
Nov 20, 2026
Parth Sojitra
DISCONTINUED PRODUCTS
Sold Out Products on Shopify and What to Do for SEO
Nov 20, 2026
Parth Sojitra
COLLECTION PAGE
Shopify Collection Page Design That Helps People Buy
Nov 20, 2026
Parth Sojitra
CUSTOMER ACCOUNTS
Shopify Store Credit for Returns and Refunds in India
Nov 19, 2026
Parth Sojitra