In this article

How to Implement Google Tag Manager on Shopify Checkout Pages

Google Tag Manager lets you track checkout actions on Shopify without editing theme code. This blog shows you how to implement Google Tag Manager on your Shopify checkout page.

Elijah Adebayo - Writer for Egnition
By Elijah Adebayo
Photo of Danell Theron
Edited by Danéll Theron

Updated November 19, 2025

a woman sitting at a table using a laptop computer

Tracking customer actions on your Shopify store plays a crucial role in understanding and growing your business. Managing multiple tags can quickly become overwhelming without the right tools and setup. Fortunately, Shopify’s recent updates offer smoother ways to handle tracking on your checkout pages.

In this blog, we will show you how to implement Google Tag Manager (GTM) on your Shopify checkout pages. By following this guide, you’ll simplify tag management and gain clearer insights into your customers’ behavior.

» Boost checkout conversions and loyalty with Egnition’s Auto Rewards Toolkit 



What Is Google Tag Manager on Shopify?

Google Tag Manager is a free tool that helps you manage different tracking tags like Google Ads, Google Analytics, and Facebook Pixel. Instead of adding each tag directly into your Shopify theme, you can place all of them in one container and control them from the GTM dashboard.

Previously, setting up GTM meant manually adding code to Shopify’s theme.liquid file. But since Shopify has phased out checkout.liquid for most plans, that method no longer works for tracking events during checkout.

Instead, Shopify now recommends using the Custom Pixels feature to implement GTM on the checkout page. This allows you to manage all tags without editing theme code directly.

Once GTM is set up through Custom Pixels, you can control all your tags from one central dashboard using a single script. This makes tracking setup and updates much easier.

» Learn how to add disclaimers to your Shopify store’s checkout process



Benefits of Implementing Google Tag Manager on Shopify Checkout Pages

Google Tag Manager on Shopify is one of the most effective tools for tracking checkout funnel milestones and making informed decisions based on real customer behavior. Below are some key areas where Shopify store owners benefit from using GTM on checkout pages:

1. Abandoned Cart Retargeting

Roughly 70% of customers leave without completing a purchase. Most store owners focus heavily on attracting new visitors, but fewer work to prevent abandoned carts. With GTM installed on your checkout page, you can capture user interactions—like cart abandonment—at specific steps in the funnel.

This makes it possible to run more targeted retargeting ads through platforms like Google Ads and Facebook.

2. Multi-Channel Conversion Tracking

GTM allows you to track conversions accurately across multiple channels by integrating tools like Google Analytics 4. When GTM is added to your checkout, you get a clearer picture of how customers move between devices and sessions.

This improves attribution accuracy and helps you identify which channels and campaigns drive conversions, meaning you can adjust your ad spend accordingly.

» Learn how to increase your conversion rates on Shopify

3. Smarter Upselling and Cross-Selling

With GTM in place, it's easier to identify purchase behavior and trigger personalized product suggestions during checkout. Whether you're upselling a premium version of a product or suggesting complementary items, GTM can help present the right offer at the right time.

Did you know? Many merchants see a 15–20% increase in average order value (AOV) from these strategies.

» Make sure you know how sessions differ from visitors

Multistore Management for Shopify

If you're using GTM to track checkout, don't let stock issues skew your data or hurt sales.

Sync inventory across all connected stores and locations.

Automatically update products and collections.

Spot and fix sync issues like missing SKUs.



How to Implement Google Tag Manager on the Shopify Checkout Page

a diagram of how to implement google tag manager in the shopify checkout page


The preferred approach for adding GTM to Shopify Plus is to implement it as a custom pixel through the Customer Events section in your Shopify admin. This method supports consistent data tracking while keeping your store secure and aligned with Shopify's upgrade-safe model.

Step 1: Prepare Your Google Tag Container

Start by logging into your GTM account and locating your GTM container ID. This ID will be used to link your Shopify custom pixel with your GTM setup.

Take Note: Shopify runs custom pixels inside iFrames, not in the main theme or HTML. This improves stability and keeps pixel code from breaking layouts, but limits GTM's preview mode and access to the full page DOM.

a screenshot of a google account with the search box highlighted


Step 2: Create a New Custom Pixel in Shopify

In your Shopify Plus admin, go to "Settings" click on "Customer Events" and click the "Add custom pixel" button.

Red arrow pointing to Settings on Google Tag Manager

Screenshot with red arrow pointing to "Add custom pixel"


Step 3: Name Your Pixel

Give your custom pixel a clear name, such as “GTM - checkout page,” then click the "Add pixel" button to proceed.

Screenshot with red arrow pointing to "Add pixel"


Step 4: Insert the GTM Container Code

Here is a custom pixel code that is tailored to track all major Shopify checkout page events, all you have to do is copy the entire JavaScript snippet (from this open source code inside the checkout.js file), paste it into the code editor on your screen.

Replace GTM-XXXXXXX with your GTM container id that you retrieved from the initial step, and click "Save".

Screenshot with arrow pointing to Save


Step 5: Click "Connect"

Arrow pointing to click connect


Click the "Connect" button once done.

Step 6: Setup GTM to Accept Events

In the custom pixel code, you’d discover that it subscribes to Shopify’s standard customer events like checkout_started etc. and then pushes this collected data to GTM’s dataLayer. This includes events occurring in the checkout process.

In your Google Tag Manager container, you have to set up variables and triggers so that data pushed from Shopify’s custom pixel can be captured. From the user-defined variable click "New".

Screenshot with red arrow pointing to Variables


Step 7: Create Data Layer Variables

For each field, you pushed (e.g., user_email, currency, transaction_id etc.), create a GTM Data Layer Variable.

a screenshot of a page showing to click on Data Layer Variable


For example, you can create a variable called “DLV – currency” and set its data layer name to "ecommerce.currency" because the currency value is stored inside the e-commerce object in the data layer.

a screenshot to name the variable

Tip: Review the source code carefully to understand which fields and events apply to your needs. You can push as many events as you want to your dataLayer—just be sure to subscribe to the relevant custom or Shopify standard events.


Best Practices for Avoiding Tracking Errors and Layout Issues With GTM

  • Avoid duplicate tracking: Make sure you don’t fire the same event twice. If you’re migrating from an old script, use Shopify’s "analytics.publish()" API instead of raw "dataLayer.push()" calls to fit the new tracking model.
  • Align with privacy and consent: Respect your customers’ privacy by checking Shopify’s Customer Privacy API before pushing any data to GTM. This ensures you only track users who have consented.
  • Test and Monitor: After creating your custom pixel, test it thoroughly to confirm it sends data correctly during checkout events. Use the Shopify Pixel Helper tool to verify which events your GTM pixel is tracking.
  • Use the correct data layer structure: Even if your custom pixel is active, GTM won't pick up events if you use the wrong event names or variable paths. Double-check that your event names and data layer variable paths match what your custom pixel pushes.
  • Don’t rely on GTM preview mode for checkout: GTM’s preview mode won’t work properly on Shopify checkout pages because they run in a secure iframe. This can make it seem like tags aren’t firing when they actually are. Instead, use the Shopify Pixel Helper extension.

» Read more: 6 Shopify customer retention strategies to increase CLV



How GTM Affects Checkout Speed and How to Reduce Its Impact

If you are implementing Google Tag Manager on Shopify checkout pages, it can impact performance if not set up carefully. Too many tags, or poorly optimized ones, can slow load times, delay the Largest Contentful Paint (LCP), and even cause layout shifts or input lag.

To Reduce This:

  • Load GTM scripts asynchronously to prevent delays in checkout page rendering.
  • Avoid heavy custom HTML tags; use built-in tag templates whenever possible.
  • Regularly audit your GTM container and remove any unused tags.
  • Delay nonessential tags until after key checkout fields have loaded.
  • Consider using a server-side GTM container to improve speed and data reliability.

» Make sure you know how to optimize your website speed to ensure a good customer experience



How Non-Shopify Plus Stores Can Use Google Tag Manager to Track Checkout Data

1. Use Custom Pixels to Track Checkout Events

If you’re not on Shopify Plus, you can still use Google Tag Manager in Shopify by creating a Custom Pixel. Inside this pixel, use analytics.subscribe() to listen for important checkout events like:

checkout_started

payment_info_submitted

checkout_completed

This sends key data such as order value, currency, and line items to the dataLayer.

Keep in mind, that non-Shopify Plus stores cannot collect detailed information from the middle of the checkout process. That level of tracking is only available for Shopify Plus stores.

2. Third-Party Apps for Better GTM Integration

Another option for non-Shopify Plus merchants is to use third-party Shopify apps made for GTM and data-layer management. After installing an app, enter your GTM container ID in its settings. The app uses Shopify’s Web Pixels API to send checkout events to the dataLayer.

Many apps include ready-made GTM templates with triggers and variables. Some also support server-side tracking for Google Ads and Facebook to improve tracking accuracy. The trade-off is a monthly fee and less control over custom data setups.

Egnition | StockIQ ‑ Out‑of‑Stock Manager

Avoid checkout data issues and missed conversions—use StockIQ to manage sold-out products automatically.

» Check out these marketing incentives to retain e-commerce customers



Boost Tracking and Customer Experience

To get meaningful data from your checkout funnel, it’s essential to implement Google Tag Manager on your Shopify checkout page. Accurate tracking helps you make smarter decisions and reduce wasted ad spend. But GTM is just one part of the bigger picture.

If you’re losing customers at checkout due to sold-out items showing too soon or too late, StockIQ - Out-Of-Stock Manager by Egnition helps you automatically manage visibility while keeping SEO intact. Using these tools can improve customer experience and boost the overall performance of your store.

» Stay ahead of stock shortages. Find out how to manage out-of-stock products effectively

Your GTM Questions Answered

What is Google Tag Manager (GTM)?

Google Tag Manager is a free tool that lets you add and manage tracking tags—like Google Analytics, Facebook Pixel, and conversion scripts—on your Shopify store without editing your theme code directly. It acts as a central place to control what gets tracked, when, and where.

Can I use Google Tag Manager on the Shopify checkout page without Shopify Plus?

Yes, but with limitations. Non–Shopify Plus merchants can still use GTM by creating a Custom Pixel and subscribing to supported events. However, access to detailed mid-checkout data is only available to Shopify Plus stores.

Do I really need Google Tag Manager on my Shopify checkout page?

Yes, if you want to understand where customers drop off, what leads to conversions, and which marketing channels are working. GTM helps you track this data in one place without adding separate scripts for each platform.



New to Shopify?

Launch your eCommerce business with Shopify's powerful platform. Get everything you need to create, manage, and scale your online store with ease. Join millions of successful merchants worldwide.

Continuous Innovation

We regularly release new features and improvements based on merchant feedback. Our development roadmap is shaped by your needs, ensuring our Shopify apps evolve with your business.

Expert Support Available

Our dedicated support team is available 24/7/365 to help with any questions about our Shopify apps. Reach us through the support icon in any app or email us at support@egnition.io

Pin It on Pinterest