How to Remove your Pre-Existing GTM Code

Learn how to remove your existing GTM code from your Shopify app

Overview

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

theme.liquid

Access theme.liquid:

  • Begin in your Shopify homepage and navigate to the "Online Stores" tab.
  • Under the "Online Store" tab, click on the "Themes" tab.
  • Navigate to the three dots, next to your current theme, and use the drop-down menu to click on the "Edit Code" button.

Remove Implementation:

  • You could have two instances that need to be removed:
    • The global
    • The global at the bottom of the body (See Figure 2).
  • 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.

Figure 1

Figure 2


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.
    • (See Figure 3)
  • 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.
    • (See Figure 4)
  • 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.

Figure 3

Figure 4


Google Analytics Additional Settings

Additional Google Analytics JavaScript:

  • Begin in your Shopify homepage and navigate to the "Online Stores" tab.
    • Once in the Online Store settings, navigate to the section titled "Preferences".
    • Then locate the "Additional Gooogle Analytics JavaScript" box.
      • (See Figure 5)
  • Remove this script and then be sure to save your changes.

_Figure 5_

📘

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.


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.

Locate Custom Pixels:

  • Begin on your Shopify homepage and click on the "Settings" button or gear icon in the lower left-hand corner of the page.
    • Once in the Settings, use the left-hand menu and click on the "Customer events" tab.
  • Review any of your custom pixels that are not associated Elevar for GTM code. Do not alter the Elevar Custom or App pixels. You are not able to edit any App pixels.
    • (See Figure 6)

Figure 6