Google Tag Manager Noscript….?

Once a new Google Tag Manager container is created, the interface asks to place two codes on the website. One in the <head> section and the second Google Tag Manager Noscript right after the opening <body> tag.

But do you know why there are two codes instead of one?

Usually tracking tools, like Google Analytics or others require to place one code on all pages, so how come GTM is different?

The <script> is the essence of the Google Tag Manager. The higher we place it in the code, the sooner it will load. Therefore, marketing and tracking tags will capture the data sooner. As a result, data will be more accurate.

This code is responsible for all the tracking magic that’s happening on a website, creates the Data Layer, initiates triggers to fire, dispatches tags, etc.

The <script> part a heavy lifter which does a lot. Without it, GTM implementation would be simply worthless.

Then why <noscript> snippet required?

Google Tag Manager noscript works only in browsers when JavaScript is off

Try to disable JavaScript for a while and browse the websites. Take a closer look at what happens. A lot of things will not work at all. There are some limitations on the web without JavaScript, therefore not many choose this option.

Now it might be clear, why that second code is surrounded by <noscript>. Because it functions only when JavaScript is disabled.

How Google Tag Manager Noscript works?

When JavaScript is off and the page is loaded, the <noscript> initiates an iFrame. An iFrame is an inline frame used inside a webpage to load another HTML document inside it (for example, a webpage within a webpage).

When the page loads, an iFrame loads as well, and tags are fired through it. That’s like a workaround for the non-JavaScript environment.

If JavaScript is enabled, the contents of the <noscript> tag are ignored and all tags are fired normally based on their standard rules.

Google Tag Manager Limitations when JavaScript is off

Only page view triggers (page view, DOM Ready and Window Loaded) work when JavaScript is off.

So, when do I need to use Google Tag Manager noscript?

You need to place <noscript> code on a website. If you want to track visitors who have disabled JavaScript on their browser.

Need help with Digital Analytics? Get in touch:

Leave a comment