Reputation: 3
Since evening of last Wednesday (March 15, 2017) I have noticed that the google analytics script is not being requested by my website consistently. When the script does load, the tags are not firing - for example for button clicks.
Is anyone else having this issue? I have searched around for threads regarding any malfunction on Google's side and could not find any. Google recently had an issue with their captcha which is why I am thinking this is an issue on their side.
To note, the site is built on a CMS and the tag manager code snippet is inherited on every page. This snippet has not been altered in the time surrounding March 15th.
Edit: Moving the code snippet from head to body creates consistent behaviour - gtm.js and analytics.js are loading and the tags are firing and registering in GA.
Upvotes: 0
Views: 5431
Reputation: 484
Check for not using dataLayer = [{...}] declaration after script part of container snippet in your pages code. This declaration should be used only before container snippet.
Upvotes: 2
Reputation: 1032
First thing to check, which you may have already done, is the position of the two code snippets used for implementation. I always position the <script>
tag first in the <head>
. Also, make sure the <noscript>
tag is the first tag rendered in the <body>
.
I had a similar issue once. My tags would inconsistently fire. After checking the console log, I found that JQuery was being declared toward the bottom of the <body>
. When I moved the JQuery tag to the <head>
, the issue was resolved. I can't imagine that you're issue is related, because my issue was due to a mistake by a developer. Nonetheless, check your console log to see if you notice any errors. It may help you determine the root of the problem.
One other thing to try is the Tag Assistant Chrome extension. Run it on your website, and it will run checks on your implementation.
Hope this helps! Let me know if you have further questions.
Upvotes: 0