Things you see in production

A company that did not quite make the cut left the following gem in a production site:

This really happened

It is hard to say what the most amusing thing is – that they tried use JavaScript to test the availability of JavaScript, that returning true in a JS function sets a value  for a var called “NoScript” or the fact that this was implemented in an angular site.

You do not usually see something that (sorry to say) ludicrous in production. But what happens to the best of us is that we forget that many things in GTM are simply not available without Javascript. Adding an image tag as fallback is all nice and well, but do not forget that your custom javascript variables will not be available in the  tags (or trigger, for that matter).

You can use a dataLayer in the noscript version – you have to add your variables as query string in the noscript part of the tag. But the noscript version is served as an iframe (well, how else), so not only GTM itself will behave differently, also the data that your tracking tags receive will be somewhat different from the javascript version (e.g. the referrer of an iframe is the parent page, not the page that referred the visitor to your site). Plus you have to look at your own infrastructure (see above) – providing noscript tags in an environment that required JavasScript to use does not make much sense.

You could possibly use a noscript fallback if you count the occasional users without javascript but frankly if you ask me, you just don’t need  to bother.

Leave a Reply

Your email address will not be published. Required fields are marked *