How to Remove your pre-existing GTM code (for GTM Shopify App)

Use this guide to learn how to remove your existing GTM code from your store before completely switching.

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:

  1. Via your theme.liquid
  2. Advanced Case via Theme Snippet
  3. Via Google Analytics additional settings
  4. Via Custom Pixel in Custom Events

1. Via your theme.liquid

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:

2. Advanced via Theme Snippet

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.

3. Via Google Analytics additional settings

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.

4. Via Custom Pixel in Custom Events

This method is less common for adding GTM to your site, but becoming more common in Shopify stores utilizing checkout extensibility as a way to add tracking throughout the checkout.

To review your custom pixels navigate to you settings, then select Customer Events.

Review any of your custom pixels that are not associated Elevar for GTM code. Shown below is an example of a pixel that should be reviewed to see if it contains GTM code.

Do not alter the Elevar Custom or App pixels. You are not able to edit any App pixels.