Analytics
5.1K members online now
5.1K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Google Tag Manager Installation

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Why are there two snippets for Google Tag Manager Installation now?

2 Expert replyverified_user

Google Tag Manager Installation

[ Edited ]
Top Contributor
# 2
Top Contributor

Because the way it gets installed has now updated/changed.

The script part of the code gets placed before the closing </head> tag
the noscript tag part of the code (for tracking those that dont have js) gets placed after the opening <body> tag.
the noscript tag isnt really necessary if you are not interested in also tracking non-js visitors

 

There were two parts to the code previously as well, just that it all got installed together as a whole piece

of code after the opening <body> tag

 

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Google Tag Manager Installation

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Thank you for the reply Bronwyn. So if my sites have the whole piece of code together after the opening <body> Do I need to move the script part before the closing </head> tag, or is the whole piece is fine in the <body> okay? 

 

Thanks.

 

Leonard. 

 

Marked as Best Answer.
Solution
Accepted by topic author Leonard D
October 2016

Google Tag Manager Installation

Top Contributor
# 4
Top Contributor

you're fine as is.

The latest recommendation comes after years of testing.

The split snippet method is really the way it should have been from the start.
It was easier for Google to recommend putting everything as opening BODY tag.

 

And as Bronwyn pointed out, the NOSCRIPT portion of the tag is fairly useless for tags other than "static" image tags and for non-JS-enabled browsers.

 

VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan

Google Tag Manager Installation

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

Thank you, Julien for your clarification.

 

Google Tag Manager Installation

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭

This Split snippets does not work with my WordPress website... Whenever I try to do it with plugin it adds "amp;" in the code automatically and give error of account ID does not match though its  exactly same as in Tag Manager. What should I do??