Playbook: GTM & Shopify

Our take on the Shopify - GTM integration with best practices, most commonly done mistakes, and so much more.

Google Tag Manager is a powerful tool, but only when it is set and used correctly. To get the best out of it, you need expert help or a Google Tag Manager app with a remarkably helpful support team: Thankfully, we know just the one!

We have prepared this playbook to guide you through this complex but helpful tool.

This playbook is focused on technical guidance. If you are interested in theoretical knowledge, you can check the following guides first:

Shopify - Google Tag Manager - Complete Guide

GTM Set up guide/tutorial on Shopify

Preconditions for the Shopify & GTM Integration

Data layers (included in Analyzify)

GTM won’t do much without advanced data layers. You need to have data layers included on your Shopify store so that GTM can process the relevant data sets attached to the related events.

Expert help or app (included in Analyzify)

GTM is easy to use, but only after a proper setup & validation. You need expert help or an app with extensive support to make sure your GTM is working correctly first.

Best Practices & Toolset

As a globally trusted analytics partner of Shopify merchants, we have completed over +1000 data analytics setups. Here is our recommended Shopify - Google Tag Manager setup:

Shopify - GTM Setup

Analyzify (Shopify App) - for advanced data layers, GTM container, setup, and validation. Our product and expert support team will be more than happy to make sure everything is working as it should be.

Google Analytics 4 Setup (through GTM)

Shopify currently offers a native integration with Google Analytics 4 using the Google Sales Channel app. The native integration offers a straightforward setup process, making it easier to implement.

It's essential to be aware that it only provides basic ecommerce events for your Shopify store, and some of the more critical ecommerce events, such as "view item list" and "view cart," are not included.

However, you can be rest assured since Analyzify’s data layers and GTM setup are used and loved by hundreds of merchants. Our initial setup includes the GA4 tracking on Shopify, in addition to e-commerce tracking.

Analyzify’s GTM setup renders the Google Ads conversion tags much better compared to the other methods.

Universal Analytics Setup (through GTM)

As Google has discontinued support for Universal Analytics, it's crucial to note that this integration method is no longer viable.

The previous approach of using UA through GTM was primarily recommended for Shopify Plus stores due to the limitations in adding GTM to checkout pages otherwise. However, there is an alternative solution available: the native integration of Shopify and Google Analytics 4 using the Google Sales Channel app. Please see the section called "Google Analytics 4 Setup (through GTM)" above.

Other Marketing / Tracking Pixels as a Backup

GTM can handle all the marketing / tracking pixels (FB Pixel, Pinterest, Tiktok, etc) - and they are actually included in Analyzify’s setup as well. However, we recommend sticking to the native integrations for various reasons. We have provided them in our setup only for backup purposes in case the native integrations don’t work well for you.

How does GTM work on Shopify?

GTM is responsible for reading the data layers and processing the relevant tags as requests. The following image should give you an idea of how it works:

How does GTM work on Shopify?
How does GTM work on Shopify?

You can also watch the video tutorial on this guide if you want to learn more in-depth information.

Common Mistakes

During the setups we have done, we have observed that the following mistakes are most commonly done by Shopify merchants or their developers.

Wrongly Placed / Missing / Duplicate GTM Container Code

The GTM container code should be placed in the “theme.liquid” file, and also in the “Order Processing” page (aka. “Thank you for your order” page, which can be accessed through Settings > Checkout > Additional Scripts for non-Shopify Plus merchants). Shopify Plus merchants should also add the container code in the "checkout.liquid" file.

Remember, there should only be one GTM container on each page of your Shopify store.

Conflict Between Native Integrations & GTM Tags

You shouldn’t use the GTM tags together with the native integrations for the same tags. As an example, if you are using Universal Analytics’ native integration, Universal Analytics tags shouldn’t be active on GTM. The same goes for Facebook Pixel: If you are using the native integration, the FB Pixel Tags on GTM also shouldn’t be used.

Inactive & Redundant GTM Tags

Each tag on GTM will load scripts on the visitor’s browser and slow down your website. So, you should pause or remove redundant tags and triggers on GTM.

FAQ on Shopify GTM

We have answered the most frequently asked questions about Google Tag Manager on Shopify on the following page.

What Analyzify Can Do

Analyzify provides a seamless connection between Shopify & Google Tag Manager together with advanced data layers, a comprehensive GTM Container, and setup & validation support.

Table Of Contents