On this page
What this issue is
A tag manager (such as Google Tag Manager, or GTM) is one script that loads many others. Your page asks googletagmanager.com/gtm.js?id=GTM-XXXXXXX for a container, and the container then starts your analytics and ad tags.
The container fails to load when that request does not come back with a valid script. Common reasons: the container ID is wrong or deleted (404), the snippet was removed in a theme or template change, a Content Security Policy (CSP) blocks the domain, a firewall or privacy tool blocks it, or a consent tool holds it back and never releases it.
Why it costs you leads or sales
The page still looks fine, so nobody notices. But conversions are not recorded, so ad platforms get no signal. Smart bidding in Google Ads and Meta optimisation then learn from less data, and reports show a sudden drop that looks like a demand problem.
- Page loadsHTML is served normally
- gtm.js requestBlocked or 404
- Tags fireGA4, Ads, Meta never start
- Conversion recordedNo event reaches the platforms
The visitor converts, but nothing is reported because the container never loads.
Example: the real number of leads stays the same, but reported conversions fall to zero when the container stops loading.
How to check if your site has it
Open DevTools on a key page
In Chrome, press F12 and open the Network tab. Tick Disable cache, then reload.
Filter for gtm
Type
gtm.jsin the filter box. You should see a request to googletagmanager.com with status 200.Read the status
404 means the ID is wrong or the container was deleted. Blocked or failed (red) points to CSP, a firewall, an extension or a network rule. No request at all means the snippet is missing.
Check the Console
Messages such as 'Refused to load the script' mean a Content Security Policy is blocking it.
Test in a clean window
Open a private window with extensions off. If it loads there, an ad blocker or extension was the cause on your own device.
The page loads, the container request fails and no tag runs.
How to fix it
Work out which cause you have from the status above, then use the steps for your platform.
| Symptom | Likely cause | Fix |
|---|---|---|
| 404 on gtm.js | Wrong or deleted container ID | Copy the ID from tagmanager.google.com and update the snippet |
| No gtm.js request | Snippet removed or not on this template | Re-add the head and body snippets |
| Refused to load script | CSP blocks googletagmanager.com | Allow the domain in script-src and connect-src |
| Blocked, net error | Firewall, CDN rule or privacy tool | Allow the request or use server-side tagging |
| Request only after consent | Consent tool holds the container | Load the container early and use Consent Mode |
Find where GTM is added
Check your GTM plugin settings (for example Site Kit or a GTM plugin) and your theme's header.php or a header-scripts option.
Correct the ID
Paste the exact GTM-XXXXXXX ID from your container. Remove duplicate installs so it loads once.
Clear caches
Purge your caching plugin and CDN, then reload and check the Network tab.
Check theme.liquid
In Online Store > Themes > Edit code, open theme.liquid and confirm the GTM head snippet is inside <head>.
Check checkout tracking
Checkout pages do not use theme.liquid. Use Settings > Customer events to add tracking there.
Confirm the container exists
At tagmanager.google.com, check the ID is correct and the container is not deleted.
Publish a version
A container with no published version serves nothing useful. Click Submit, then Publish.
Open custom code
Go to Site settings > Custom code and check the Head code and Footer code boxes for the GTM snippet.
Publish the site
Custom code only goes live after you publish.
Add to funnel or site tracking code
In the funnel or website settings, paste the GTM snippet in the Head tracking code. Do this per funnel, as it is not global.
Use the Google Tag Manager integration
In Marketing integrations, connect your container ID, or add a custom code snippet in Settings > Custom code set to load on all pages in the head.
Check Code Injection
In Settings > Advanced > Code Injection, confirm the GTM snippet is in the Header field. Code injection may need a plan that supports it.
Add both snippets
Put the script as high in <head> as you can and the noscript iframe right after the opening <body> tag, on every template.
Update CSP
Allow the Google domains in your Content Security Policy headers.
<!-- In <head> -->
<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=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXXXXX');</script>
<!-- Right after <body> -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>script-src 'self' https://www.googletagmanager.com;
img-src 'self' https://www.googletagmanager.com;
connect-src 'self' https://www.googletagmanager.com https://www.google-analytics.com;
frame-src https://www.googletagmanager.com;How to confirm it's fixed
- gtm.js returns status 200 on the home page, landing pages and thank-you page
- The right container ID appears in the request URL
- No CSP or network errors in the Console
- GTM Preview mode (Tag Assistant) connects to the site and shows tags firing
- A test form or purchase appears in GA4 DebugView or the platform's test tool
How to prevent it happening again
- Re-test tracking after every theme, plugin, CDN or security header change
- Keep one owner for the container and do not delete containers still in use
- Load GTM from one place only, to avoid duplicates and conflicts
- Review CSP and firewall rules whenever you add a new tool
- Run a scheduled check of key pages so a break is found in hours, not weeks
Day 0
A theme update drops the GTM snippet from the landing page template.
Day 1
Reports show fewer conversions. The page looks normal.
Day 7
Ad platforms optimise on thin data and results slip.
Day 10
Someone checks the Network tab and re-adds the snippet.
How FunnelGuard handles this
FunnelGuard detects this today. A robot visitor loads your pages on a schedule from the EU or the US and checks the tracking hits sent to GA4, Google Ads, Meta and other platforms. When the container is missing or fails, the check note is tag_missing: the expected tag or container was not found loading.
A failure is re-checked from a second region before one alert goes out by email, Slack, Teams, WhatsApp, webhook or PagerDuty, with a screenshot and a likely cause. Test traffic is marked (utm_source=funnelguard, fg_test=1) and never bypasses CAPTCHAs or bot protection. The Free plan covers 1 site and 2 journeys with daily checks and no card, and paid plans have a 3-day free trial.
Questions people ask
Why is my Google Tag Manager container not loading?
The usual causes are a wrong or deleted container ID (404), a snippet removed from a template, a Content Security Policy blocking googletagmanager.com, or a firewall or privacy tool blocking the request. Open DevTools, go to Network, filter for gtm.js and read the status to see which one it is.
How do I check if GTM is installed correctly?
Reload the page with the Network tab open and filter for gtm.js. A status 200 from googletagmanager.com with your GTM-ID means it loads. You can also use Tag Assistant or GTM Preview mode to confirm the container connects and tags fire.
What does a 404 on gtm.js mean?
It means Google could not find a container with that ID. The ID is mistyped, belongs to a deleted container, or was copied incorrectly. Copy the ID again from tagmanager.google.com and update your snippet.
Can a Content Security Policy block Google Tag Manager?
Yes. If script-src does not allow https://www.googletagmanager.com, the browser refuses to load gtm.js and logs a 'Refused to load the script' error in the Console. Add the domain to script-src, and also to img-src, connect-src and frame-src as needed.
Do ad blockers stop Google Tag Manager from loading?
Many do, so some visitors will never run your tags. You cannot control their browsers, and you should not try to bypass their choices. Server-side tagging on your own domain can reduce the loss, if it fits your consent rules.
Will my tags work if the GTM container is not published?
Not as expected. A container with no published version has nothing to serve, so no tags run. Click Submit then Publish in Tag Manager, and check the live version number.
How can I know quickly when my tag manager stops loading?
Use scheduled monitoring. FunnelGuard runs your journeys on a schedule, checks that the tag loads and tracking hits are sent, and alerts you with a screenshot and likely cause after a second-region re-check.
Related issues
- PRF-099Third-party script fails to load (chat, form, payment widget)Fix guide
- PRF-111Third-party script throws console errorsFix guide
- PRF-113Ad blockers break core functionality (site depends on blocked script)Fix guide
- PRF-100Third-party script slow and blocks renderingFix guide
- PRF-109Google reCAPTCHA fails to load, blocking form submitFix guide
- PRF-101Chat widget loads 1 MB+ on every pageFix guide