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 | Show 1 more comment5 Answers
Reset to default 37I 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.
firebase.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