Don’t Get Left Behind: Updated Guidance on Deploying Google Tag Manager on Shopify

Estimated Reading Time: 7 minutes
July 8, 2025
Don’t Get Left Behind: Updated Guidance on Deploying Google Tag Manager on Shopify

For retail and eCommerce brands, achieving accurate, quality data from your Shopify store is more critical than ever. Recent changes to the Shopify platform, particularly concerning the checkout flow, have introduced new challenges to comprehensive measurement and performance tracking.

Historically, tracking any part of a Shopify store and checkout involved a relatively straightforward process of adding custom code to the template. However, with Shopify’s updated policies no longer permitting custom code directly within the checkout flow, ensuring data quality for purchases and conversions has become more complex. This presents a significant hurdle for brands aiming to understand the true impact of their marketing efforts.

So, how can you navigate these new restrictions while still optimizing your marketing investments? Google is guiding merchants toward their native Google & YouTube app for integrating Google Analytics, Google Ads, and Floodlight tags. But what about other crucial platforms like Google Tag Manager (GTM), Facebook, Snapchat, Pinterest, and TikTok?

Let’s delve into why a complementary GTM implementation remains essential for your third-party marketing and advertising platforms. We’ll also explore how to maintain high accuracy and quality in your conversion data, giving you the confidence to drive informed business decisions.

An Evolved Dual Strategy for Effective Shopify Measurement

Google’s recommended approach for seamless and supported Google measurement across Google Ads, Analytics, YouTube, and Merchant Center within Shopify’s new checkout experience is to leverage the Google & YouTube app. This app is specifically designed to ensure compatibility with Shopify’s evolving platform, particularly on crucial post-checkout pages (Thank You and Order Status pages).

However, Google Tag Manager is a robust and versatile tag management system capable of managing a wide array of tracking pixels beyond just Google’s. This includes vital platforms like Meta (Facebook/Instagram), Pinterest, TikTok, and other marketing and analytics solutions. Therefore, a primary reason to continue utilizing GTM is to centralize the management of these non-Google, third-party tags. While the Google & YouTube app is the go-to solution for Google-specific measurement, you still need an easily manageable solution for all your other essential services.

Leveraging Shopify’s Platform Features Alongside GTM Tagging

Shopify’s platform updates, including the new checkout experience, mean that older tagging methods like checkout.liquid or “additional scripts” on the Order Status page are being deprecated. To maintain comprehensive data collection, especially on critical post-checkout pages, you must adopt Shopify’s newer features:

  • Custom Pixels: Shopify offers a “custom pixel” feature that allows you to run code within a sandboxed environment. While directly running a GTM container for Google tags via Custom Pixels isn’t officially supported or guaranteed by Google (the Google & YouTube app is preferred for this), Custom Pixels are the supported mechanism to recreate customizations and continue tracking customer events on the new Thank You and Order Status pages. Any tagging solution, including a GTM implementation primarily for non-Google tags, will need to be added via these new, supported Shopify methods to reliably track events on these crucial pages.
Customer events | Shopify
  • Shopify’s Data Layer / Standard Events: The Google & YouTube app captures specific eCommerce events based on the standard event API provided by Shopify. Any manual tagging or GTM implementation should aim to leverage this standard data structure to ensure consistent and accurate event tracking. By using the Shopify API, you can subscribe to the events you want to collect and push relevant parameters to GTM via dataLayer.push().
shopify data layer GTM
  • Shopify’s Customer Privacy API: This is critical for consent management. Tags loaded by the Google & YouTube app automatically react to Shopify’s Customer Privacy API. It is highly recommended that any Consent Management Platform (CMP) you use integrates with this API, or your shop utilizes the native Shopify consent banner. Ensuring your GTM setup respects user consent means connecting it properly to a CMP that integrates with Shopify’s API and user consent selections are sent to GTM with each event’s dataLayer push.
Mapping Shopify consent with OneTrust CMP
Example: Mapping Shopify consent with Onetrust CMP

Considerations When Deploying GTM via Custom Pixels

Deploying a GTM container through Shopify’s Custom Pixel feature differs slightly from previous methods (like adding directly to the liquid theme). This is primarily due to custom pixels executing within an iframe, a “sandboxed” environment that doesn’t operate at the main page level. This introduces several limitations:

  • Preview/Debug Mode: A key consideration is that GTM’s familiar preview and debug mode features will not function as expected when the container is loaded within a custom pixel. This means traditional real-time debugging of tags, triggers, and variables via the GTM preview console is unavailable. Organizations choosing this path must rely on alternative debugging techniques within browser developer tools (e.g., console logging) and meticulous code review to verify functionality.

  • Built-in Variables: GTM’s built-in variables assume the container is loaded from the top-level frame of a website page, with direct access to the main window and browser objects. When loaded within an iframe, these built-in variables may not return values or may return inaccurate ones. Any specific page variables required for data collection in GTM should be passed manually in the custom pixel’s dataLayer.push() using available Shopify Standard API methods.

  • Auto-Event Triggers: GTM’s built-in automatic event triggers (such as click listeners, form submissions, and scroll tracking) are affected in this sandbox environment. Automatically tracking user interactions without writing specific code is not feasible. To capture such events, custom JavaScript code is required within the custom pixel, utilizing Shopify DOM events to listen for click and form interactions and then pushing dataLayer events directly to the GTM container.

  • Pushing DataLayer Events: Effectively getting data from the Shopify environment to a GTM container in this setup necessitates JavaScript code within the custom pixel to listen for Shopify customer events and manually push the required data using a dataLayer.push() event.

What About Server-Side GTM?

Currently, Google does not support server-side GTM (sGTM) implementation via the Google & YouTube app. While this is hopefully a future feature enhancement, as of today, server-side GTM can only be implemented through Custom Pixels.

Next Steps for Your Shopify Data Strategy

Implementing a robust data collection strategy on Shopify that accounts for these platform changes is essential for any retail or eCommerce business. This involves a dual approach: primarily using the Google & YouTube app for Google products and a carefully planned strategy for third-party tags using supported Shopify features like Custom Pixels. Understanding which tags belong where and ensuring they function correctly within Shopify’s new architecture and consent framework is paramount.

To get started, we recommend taking inventory of your current data collection mechanisms within your shop’s liquid templates, existing custom pixels, and app pixels. From there:

  1. Remove unused platforms: Streamline your setup by removing tracking for platforms you no longer actively use.

  2. Migrate Google data collection: Transition your Google-related data collection to the Google & YouTube app for optimal performance and compatibility.

  3. Determine remaining GTM needs: Identify which remaining third-party data collection should reside within your GTM container, managed via Shopify’s Custom Pixels and standard event API.

Need expert assistance optimizing your Shopify data collection using Google Tag Manager or navigating Shopify’s evolving platform changes? Contact InfoTrust for specialized support in enhancing your shopping and eCommerce analytics.

Need help or want to talk more?

Contact InfoTrust for expert assistance around your shopping and eCommerce analytics.

Author

  • Rachel Joss

    Rachel Joss is the leader of tag management at InfoTrust, specializing in data collection, consent management, and server-side topics. With more than five years of experience, she assists clients to create robust and durable website data collection setups and develops best practices and processes used in global organizations’ websites. Rachel enjoys finding new technical solutions and opportunities for advancing customers' data collection. She currently lives in Cleveland, Ohio, and balances her technical time with time spent outdoors on her small farm.

    View all posts
Last Updated: July 28, 2025
Talk To Us

Get Your Assessment

Thank you! We will be in touch with your results soon.
{{ field.placeholder }}
{{ option.name }}

Talk To Us

Talk To Us

Receive Book Updates

Fill out this form to receive email announcements about Crawl, Walk, Run: Advancing Analytics Maturity with Google Marketing Platform. This includes pre-sale dates, official publishing dates, and more.

Search InfoTrust

Leave Us A Review

Leave a review and let us know how we’re doing. Only actual clients, please.