I covered the most common issue with tags not being activated in Google Tag Manager in my article about the status ‘still running’. However, there is an additional issue you may encounter with Google Analytics: tags that display status Failed, which refuses to send any data to Google Analytics.
There are several possible reasons for this, and we will explore them in this article.
Note that Which It can indicate the tag type in Google Tag Manager Failed. With the advent of custom templates, more and more templates are becoming do it right, which means that it is explicitly inferred Failed The situation when the tag encounters problems. This is not the case with many original templates – they eat errors and refuse to indicate that something is wrong.
Simmer . Newsletter
Subscribe to the Simmer newsletter to get the latest news and content from Simo Ahava right in your inbox!
There are two reasons (I can think of) this behavior appears.
Reason 1: the analytics.js library is blocked
If your browser is blocking The analytics.js library, which means the client is unable to load it from
https://www.google-analytics.com/analytics.js, the tag will point to a file Failed Status.
This could be due to browser extensions like Ghostery or uBlock Origin, or it could be a firewall setup in your network. can even be the browser itself (Firefox in a private window, for example).
The easiest way to check if this is the cause is to open a file network tab of your browser’s developer tools, and search for
analytics.js. If it is blocked, it should not appear at all, or should appear with a clear indicator. In some browsers, you will see messages about resource blocking in the browser console.
The image above is from Firefox.
Noticeable! If the analytics.js library can load, but the extension or browser blocks calls to a file
www.google-analytics.com/collectEnd point, will tag Not Signal Failed Status.
Reason 2: The namespace is busy
When the Google Analytics library is loaded, it tries to create a file global way the name of the thing
ga (by default). The name of this method can be changed in the analytics.js snippet as well as in Google Tag Manager (see below).
However, if this global variable is already used, Google Analytics fails to initialize and the flag state is set to Failed.
the answer Should It looks something like this:
However, they are minified and can change, so it’s not a robust way to check them. Alternatively, you can also try this:
If you get
undefined, it means that Google Analytics has Not Loader, and something else that occupies the namespace.
window variable too, as long as they have a file
In other words, if the page contains an HTML element whose ID is the same as the name of the Google Analytics object (
console.log(document.querySelector('#' + window.GoogleAnalyticsObject));
If this returns an HTML element, then you have this exact problem.
So, what is the fix?
You just have to do it Once, so it doesn’t matter if it’s in the Google Analytics settings variable or in the settings of an individual tag. You are Act Want to make sure that the change in first The tag that is activated on the page, so make the change in everyone Your tags are a good precaution.
You can find the setting by expanding advanced configuration From the Universal Analytics tags (or the Google Analytics settings variant).
Write a new value in a file public office name domain, make sure This is amazing The variable is not reserved (for example, run
Once you make this change, your tags should start working fine.
It’s an extreme case, but when it hits you, it can be very difficult to correct.
However, when there is He is conflict, you are usually left with two options:
Find the conflicting script or HTML element, and fix it.
Accept defeat and modify the settings of the Universal Analytics tag that is active on the page.
Both have their drawbacks. sometimes you I can not Changing the conflicting script, because the script does not have the ability to support changes in the global namespace. And sometimes changing the method name in your tags can cause problems when trying to figure out why first-party and third-party scripts that depend on the default method name are supported (
ga) Suddenly stopped working.
The important thing is to know how to correct the problem and sort it out. We hope this article provides some guidance on how to do this.