If you've previously set up Google Tag Manager on your site, you will need to remove your old implementation to prevent duplicate tag firing.
The two most likely places you've implemented GTM previously are:
You can verify this by going to your Admin > Online Store > Themes > Current Theme > Actions: Edit Code > View theme.liquid file
You should have two instances that need to be removed:
- The global
- The global at the bottom of the body
Here is what it would look like in the head:
Here is what it would look like at the bottom of the body:
If this is how you have GTM implemented, then you'll need to remove these AFTER you have our GTM container imported and the GTM configuration ID setup in the app settings here:
If you are unable to find your GTM code in the theme.liquid but know that is added through your theme it may be added via a snippet. You can view the snippets and may be able to find this code via the snippet naming. However when script is added via snippet they are often added via custom created snippets and the naming will vary greatly. In this example I'm showing the tracking snippet is named tracking-code.liquid, however your's could be something completely different.
Example of snippet containing GTM Code shown below
Example of snippet being rendered in theme
Once you have located your GTM code remove the code. If this would be all the code in the snippet you may also remove the snippet reference from the theme.liquid
It is recommend to use a theme search extension such as Shopify Theme File Search by EZFY to locate your GTM script. Install the extension and search for your GTM container ID to local what files in your theme contain this code.
The other common method that many Shopify stores implement GTM is via the additional script settings for Google Analytics which is found in Admin > Online Store > Preferences:
If this is how you have implemented yours then you can simply remove this and save.
Worried You’re Making Decisions on Data You Can’t Trust?
Check out our blog and discover Shopify Optimization & Analytics Tips from Elevar's data experts.
Updated 1 day ago