Google Tag Manager
This page was printed on Mar 22, 2023. For the current version, visit https://help.shopify.com/en/manual/reports-and-analytics/google-analytics/google-tag-manager.
Considerations for using Google Tag Manager
To use Google Tag Manager with your Shopify Plus online store, you need to do the following:
- Get access to the
checkout.liquid
file. If you don't have access to this file in your theme code, then contact Shopify Plus Support to gain access. - Use Shopify's integration for Google Analytics and Facebook Pixel instead of using them with Google Tag Manager.
- Copy the code snippets that are provided by Google Tag Manager into your
theme.liquid
andcheckout.liquid
theme files.
Add Google Tag Manager code to your theme
Steps:
- Install Google Tag Manager to get the code snippets that you will need to copy and paste into your Shopify store. Because Shopify uses templates, you only need to copy the snippets into the
theme.liquid
andcheckout.liquid
files.- If this is your first time installing Google Tag Manager, then use the installation steps provided by Google Tag Manager. Pause at the step where you are given two code snippets to add to your web pages, and then follow the instructions below.
- If you have already installed Google Tag Manager, then you can find these code snippets in your Google Tag Manager by clicking Admin, and then clicking Install Google Tag Manager.
- In your Shopify admin, click Online store, and then click Themes.
- In the theme drop-down, click Edit Code.
- Copy the first code snippet from Google Tag Manager into the
<head>
tags of yourtheme.liquid
andcheckout.liquid
code:- Copy the first code snippet from Google Tag Manager
- In your Shopify admin, open your
theme.liquid
file. - Paste the code snippet as high in the
<head>
of thetheme.liquid
code as possible. - Open your
checkout.liquid
file. - Paste the code snippet as high in the
<head>
of thecheckout.liquid
code as possible.
- Copy the second code snippet from the Google Tag Manager into the
<body>
tags of yourtheme.liquid
andcheckout.liquid
code:- In your Shopify admin, open the
theme.liquid
page. - Paste the code snippet as high in the
<body>
of thetheme.liquid
page as possible. - Open the
checkout.liquid
page. - Paste the code snippet as high in the
<body>
of thecheckout.liquid
code as possible.
- In your Shopify admin, open the
- In your Shopify admin, click Save.
- In Google Tag Manager, continue installing the Google Tag Manager.
When prompted to add tags, do not add the following types of tags:
- Universal Analytics for Google Analytics
- Classic Google Analytics for Google Analytics
- Facebook Pixel.
Verify that Google Tag Manager is installed
To verify that you installed Google Tag Manager properly, you can use:
- the Preview Mode in Google Tag Manager
- the Google Tag Assistant Chrome Extension.