Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2011
    Location
    Adelaide, Australia
    Posts
    1,670
    Plugin Contributions
    1

    Default Google Tag Manager - where exactly do I add the codes??

    1.5.5f php7.1

    I want to add Google Tag Manager to my site - I am unsure of which files to add the codes suggested by Google so need some help please;

    Copy the following JavaScript and paste it as close to the opening <head> tag as possible on every page of your website, replacing GTM-XXXX with your container ID: [is this file correct; includes/languages/english/mytemplate/html_header.php ???? - and best position for it ???]

    Code:
    <!-- Google Tag Manager -->
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    new Date().getTime(),event:'gtm.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/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','GTM-XXXX');</script>
    <!-- End Google Tag Manager -->
    Copy the following snippet and paste it immediately after the opening <body> tag on every page of your website, replacing GTM-XXXX with your container ID: [not sure where to put this ??]

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

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,475
    Plugin Contributions
    88

    Default Re: Google Tag Manager - where exactly do I add the codes??

    That first set of bits goes into your template's /common/html_header.php; the second towards the bottom of your template's /common/tpl_main_page.php.

  3. #3
    Join Date
    Jan 2011
    Location
    Adelaide, Australia
    Posts
    1,670
    Plugin Contributions
    1

    Default Re: Google Tag Manager - where exactly do I add the codes??

    Quote Originally Posted by lat9 View Post
    That first set of bits goes into your template's /common/html_header.php; the second towards the bottom of your template's /common/tpl_main_page.php.
    Many thanks Cindy !!

 

 

Similar Threads

  1. Data Layer for Google Tag Manager
    By enzo-ita in forum General Questions
    Replies: 20
    Last Post: 1 Aug 2017, 02:12 PM
  2. Where do I add new zip codes for free delivery?
    By spookyghost in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 26 Sep 2008, 11:51 AM
  3. Exactly where do I find...
    By Foxys in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 6 Jan 2008, 08:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR