Google Tag Manager isn’t loading javascript, error message “anonymous function”

I have installed Google Tag Manager on my website, and am using it to load some Javascript onto my site. However, GTM is no longer loading, my Javascript isn’t loading, and the error code is not very helpful.

Here is the GTM code on my website:

<!-- Google Tag Manager -->
<noscript><iframe src=""
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
<!-- End Google Tag Manager -->

This is the code I am including in the GTM Tag:

<!-- Qualaroo for your website -->
<!-- Paste this code right after the <body> tag on every page of your site. -->
<script type="text/javascript">
  var _kiq = _kiq || [];
    var d = document, f = d.getElementsByTagName('script')[0], s = d.createElement('script'); s.type="text/javascript";
    s.async = true; s.src="";f.parentNode.insertBefore(s, f);
    }, 1);

When I look at the Chrome Javascript Console, I get the message:

(x) Failed to load resource

And when I reload the page, I see:

(x) GET    index.html:45
        anonymous function                                       index.html:45
        anonymous function                                       index.html:46

Going to these lines gets me these lines from my GTM code:


I’ve been googling like crazy to try to figure this out, but I’m out of my depth for a lot of this. The error message “anonymous function” seems to be especially hard to search for, even within GTM and other Google support documentation.

I noticed the same issue when you don’t have any published tag, once you publish the version the JS will load successfully.

Do you have adblock plus installed? It used to block The errors looked just like this.

Read More:   How can I use webpack with express?

Try disabling it and refreshing the page. If that fixes it, all you need to do is update your AdBlock filters. Google and AdBlock worked this out in early 2013, so updated versions of AdBlock filters will stop blocking google tag manager.

Also, it looks like you’re using Google Tag Manager to load Qualaroo surveys. Please don’t bother Qualaroo’s customer service with this problem; it’s not their fault Google got themselves blacklisted by AdBlock.

I get this message also when the container isn’t published in Tag Manager.

The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .

Similar Posts