Skip to content

How to remove Google Tag Manager snippets from Shopify

  1. Go to your “Themes”

    Go to Shopify Admin, and from the left-hand menu select “Themes” under “Online Store”

  2. Open theme editor

    imgOpenTheme From the right side under “Current theme” select “Actions” and then “Edit code”. This will open your theme editor.

  3. Open “theme.liquid” file

    In theme editor open “theme.liquid” which is in the “Layout” folder.

  4. Delete the main Google Tag Manager snippet

    Find the Google Tag Manager snippet between <head> and </head> tags, and remove it.

    <!-- Google Tag Manager -->
    <script>(function(w,d,s,l,i){w[l] = w[l] || [];w[l].push({'guides.start':
    new Date().getTime(),event:'guides.js'});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    'https://www.googletagmanager.com/guides.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','GTM-K8CD3DF');
    </script>
    <!-- End Google Tag Manager -->

  5. Scroll down and delete the “noscript” Google Tag Manager snippet

    Find the “noscript” Google Tag Manager snippet between <body> and </body> tags, and remove it.

    <!-- Google Tag Manager (noscript) -->
    <noscript>
    <iframe src="https://www.googletagmanager.com/ns.html?id=GTM-K8CD3DF"
    height="0" width="0" style="display:none;visibility:hidden"></iframe>
    </noscript>
    <!-- End Google Tag Manager (noscript) -->

  6. Save “theme.liquid” file

    Finally, click “Save”.