Jump to content

Google Tags Manager - where to insert on


Recommended Posts

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 -->
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
<!-- 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

Share this post

Link to post
Share on other sites

  • 3 weeks later...

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.

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More