最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Script loading failure from googletagmanager - Stack Overflow

programmeradmin1浏览0评论

So I added google analytics to my site, and the code snippet that google gave me was this:

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src=";></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-124075233-1');
</script>

So I added it to my <head>, but now I'm receiving the error:

Loading failed for the with source “”.

I'm a bit confused as to why this is happening.

So I added google analytics to my site, and the code snippet that google gave me was this:

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-124075233-1"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-124075233-1');
</script>

So I added it to my <head>, but now I'm receiving the error:

Loading failed for the with source “https://www.googletagmanager.com/gtag/js?id=UA-124075233-1”.

I'm a bit confused as to why this is happening.

Share Improve this question edited Aug 22, 2021 at 13:03 Eric Aya 70.1k36 gold badges189 silver badges259 bronze badges asked Aug 22, 2018 at 1:16 FelixFelix 2,6616 gold badges43 silver badges83 bronze badges 6
  • 4 It works fine for me on your website. Can you check if you have any adblocker installed which prevents GA ? – Tushar Gupta Commented Aug 22, 2018 at 1:22
  • Still getting the error in firefox. Chrome gives me an error as well, but only on refresh. – Felix Commented Aug 22, 2018 at 1:24
  • I checked on Firefox, and still works ok for me! no error at all. Check for Ad blockers and your browser updates – Tushar Gupta Commented Aug 22, 2018 at 1:28
  • I had same problem. and solved with @zacaway's answer. My problem caused by adguard! – luceat-lux-vestra Commented May 30, 2021 at 12:49
  • I did not resolve this, but instead I commented outfirebase.analytics() and this error went away. Since i wasn't using analytics anyways so that's not a problem for me. – TheTechGuy Commented Jun 11, 2021 at 19:25
 |  Show 1 more comment

5 Answers 5

Reset to default 37

I had the same problem. It turned out to be the DuckDuckGo Privacy Essentials browser extension that I was using was blocking the Google tracker request. Just disabling this extension for the site resolved the problem.

I suggest checking to see if you have a similar browser extension that is blocking the request.

I had the same issue but basically it's just because you're using a tracker blocker (like Ghostery). If you're using one, you will probably see this message in more than just your website. Try to whitelist your site and see if it works well

Please check your code, where do you put that code? are you using cms like WordPress? it's possible you put in the wrong place, for example, you put that code between <?php tag

Another thing to check is your adblocker. I used v2rayn for my proxy and blocked some ad sites, and somehow googletagmanager.com was one of them.

I had the same problem with a user, but here was blocking also zendesk plugin.

He was using Adguard, disabling this app started to work again.

Check if you has any adblock component in your machine.

发布评论

评论列表(0)

  1. 暂无评论