How to add Google Tag Manager on Shopify
You can use Google Tag Manager with your Shopify Plus online store, as long as you:
Use Shopify’s integration for Google Analytics and Facebook Pixel instead of using them with Google Tag Manager.
You copy the code snippets, that are provided by Google Tag Manager, into your theme.liquid and checkout.liquid theme files.
Step 1: Install Google Tag Manager.
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 and checkout.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:
Step 2: Go to the Online store.
Start from your Shopify admin, choose Online Store.
Step 3: Choose Edit code.
Inside the Online Store page, click Themes, and choose Edit code.
Step 4: Copy the first code snippet from Google Tag Manager into the <head> tags of your theme.liquid code:
1. Copy the first code snippet from Google Tag Manager
2. In your Shopify admin, open your theme.liquid file.
3. Paste the code snippet as high in the <head> of the theme.liquid code as possible.
Step 5: Copy the second code snippet from the Google Tag Manager into the <body> tags of your theme.liquid code:
1. Copy the second code snippet from the Google Tag Manager
2. Paste the code snippet as high in the <body> of the theme.liquid page as possible.
### Step 6: Click Save
### Note: 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.