Why does gtm.js return a 404 - wrong container ID, blocked request, or something else?
A literal 404 on the gtm.js request (as opposed to a blocked or failed request with no status) almost always means the container ID in your snippet does not exist or was deleted or moved to a different account - a typo, a leftover snippet from a decommissioned container, or an ID copied from a different property. It is rarely an ad blocker, since blockers typically prevent the request entirely rather than letting it complete with a 404.
Why this happens
googletagmanager.com/gtm.js?id=GTM-XXXXXXX looks up the container matching the ID in the query string and serves its published configuration - if that ID does not correspond to any container Google's servers can find, the server correctly returns a 404 for "this container doesn't exist," which is different from a blocked request (shown as (blocked) or net::ERR_BLOCKED_BY_CLIENT with no server response at all).
Fix it
- Open the Network tab, find the gtm.js request, and check the exact status: a genuine 404 (server responded, said not found) points to the container ID; a blocked status with no real HTTP response points to an ad blocker or extension instead - these need different fixes.
- If it is a true 404, copy the exact container ID from the failing request's query string and compare it character-for-character against the ID shown in your GTM account - a single transposed character is the most common cause.
- Check whether the container was ever published - a container with zero published versions will not serve gtm.js successfully even with a correct ID.
- Confirm the container has not been deleted or moved between GTM accounts (a re-platforming, an agency handoff) - a container ID is permanent to the account it was created in, and copying a snippet from documentation or an old backup is a common source of stale IDs.
- If it is a blocked request rather than a genuine 404, that is expected behavior from ad blockers on some fraction of visitors and is a measurement-coverage question, not a bug to fix on your end.
How to verify it worked
After correcting the ID (or confirming the container is published), reload with the Network tab open and confirm gtm.js returns a 200 with a JavaScript content type, then open GTM Preview and confirm it connects to the corrected container.
Still stuck after working through this?
Send us what you are seeing in Preview and the Network tab. We trace GTM containers for a living and can usually tell you what is actually happening in one look.
Ask a GTM Engineer