cattty Posted September 4, 2017 Share Posted September 4, 2017 Hello, I was trying to insert the Google Tags on the site. In the tutorials I have found so far online and on this forum they are talking al the time about ONE piece of code which should be inserted in the <body > of header of the template. But Google asks about 2 pieces: Copy the code below and paste it on to every page of your website. Paste this code as high in the <head> of the page as possible: <!-- 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-XXX');</script><!-- End Google Tag Manager --> Additionally, paste this code immediately after the opening <body> tag: <!-- Google Tag Manager (noscript) --><noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXX"height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript><!-- End Google Tag Manager (noscript) --> So, I am a bit lost where these two pieces should be inserted. One in the <body> of header and another one in the <body> of footer? And both of them should be written with (literal)? Thank you in advance Link to comment Share on other sites More sharing options...
cattty Posted September 21, 2017 Author Share Posted September 21, 2017 I have solved this problem myself: both pieces should be inserted in the header.tlp . The first one should go in the head of the header, and the second piece - in the body of the header. Both pieces should be written starting from "Literal" and finishing with "/literal" using special curvy brackets. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now