Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Script loading failure from googletagmanager

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.

like image 313
Felix Maxime Avatar asked Aug 22 '18 01:08

Felix Maxime


People also ask

Why is GTM not working?

The content security policy is blocking the GTM from loading. If your website has a Content Security Policy, it might block GTM's preview mode. You can identify this by going to your browser's developer console (On Windows, Chrome, you should go to Browser's Menu > More Tools > Developer Tools > Console.

What is Googletagmanager com GTAG?

The Google tag (gtag. js) is a JavaScript tagging framework and API that allows you to send event data to Google Analytics, Google Ads, and Google Marketing Platform.

Do you need GTAG js If you have GTM?

If you currently use Tag Manager, you should continue to do so. Google Ads and Google Marketing Platform tags are fully supported by Tag Manager, and there is no need to deploy additional gtag. js-based code on your site if Tag Manager is already in use.


2 Answers

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.

like image 109
zacaway Avatar answered Oct 17 '22 09:10

zacaway


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

like image 33
Anime no Sekai Avatar answered Oct 17 '22 08:10

Anime no Sekai