404 error for Google Tag Manager
GetGoogle Tag-ManagerGet Problem Overview
Google Tag Manager told me to put this underneath the opening body
tag.
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-XXXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXXXX');</script>
<!-- End Google Tag Manager -->
Now I'm getting this 404 not found for GET:
GET http://www.googletagmanager.com/gtm.js?id=GTM-XXXXXX
I implemented the code last night. Does this just take time or is this something that needs to be fixed? If the latter, how would I fix it?
Get Solutions
Solution 1 - Get
You need to publish a version of your container. If it is not published, the request will return a 404 error.
> To publish your current workspace: >
- Click Submit at the top right hand side of the screen. The Submit Changes screen will appear, with options to publish the container and save a version of your container.
- Select Publish and Create Version if it is not already selected.
- Review the Workspace Changes section to see if your configuration appears as you expect.
- Enter a Version Name and Version Description.
- If you have Tag Manager configured to use multiple environments, use the Publish to Environment section to select which environment you'd like to publish to.
- Click Publish.
Solution 2 - Get
I had the same issue even after publishing and got it fixed by simply deleting the subdomain "www" from the tag manager domain "https://googletagmanager.com" instead of "https://www.googletagmanager.com"
Seems the problem is that the DNS is blocking www. or the subdomain doesn't reroute properly to our region!
Solution 3 - Get
My issue was that had AdBlock enabled.
Solution 4 - Get
In my case it helped when I leave Preview and lunch it again. As I figured out my preview "outdated" somehow...
Solution 5 - Get
As of this writing, you don't need to publish the container to fix the Error 404 when you first create the container. You can just do a preview and the error 404 should be gone.
Solution 6 - Get
You must publish the container once you create it. It's doesn't matter the container is empty, just publish it.