Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Tag manager container fails to load: how to find and fix it

PRF-112High impactDetectedBy FunnelGuardPublished Updated
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.

Where a failed container breaks the chain
  1. Page loadsHTML is served normally
  2. gtm.js requestBlocked or 404
  3. Tags fireGA4, Ads, Meta never start
  4. Conversion recordedNo event reaches the platforms

The visitor converts, but nothing is reported because the container never loads.

Conversions reported before and after the container breaksExample numbers
Conversions reported before and after the container breaks (example)Actual leads: 40 conversions per week; Reported, container working: 38 conversions per week; Reported, container failing: 0 conversions per week0153140380Actual leadsReported, container w…Reported, container f…conversions per week

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

Check the container request in your browser
  1. Open DevTools on a key page

    In Chrome, press F12 and open the Network tab. Tick Disable cache, then reload.

  2. Filter for gtm

    Type gtm.js in the filter box. You should see a request to googletagmanager.com with status 200.

  3. 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.

  4. Check the Console

    Messages such as 'Refused to load the script' mean a Content Security Policy is blocking it.

  5. 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.

A container that never loads

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.

What each symptom usually means
SymptomLikely causeFix
404 on gtm.jsWrong or deleted container IDCopy the ID from tagmanager.google.com and update the snippet
No gtm.js requestSnippet removed or not on this templateRe-add the head and body snippets
Refused to load scriptCSP blocks googletagmanager.comAllow the domain in script-src and connect-src
Blocked, net errorFirewall, CDN rule or privacy toolAllow the request or use server-side tagging
Request only after consentConsent tool holds the containerLoad the container early and use Consent Mode
Restore the container on your platform
  1. 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.

  2. Correct the ID

    Paste the exact GTM-XXXXXXX ID from your container. Remove duplicate installs so it loads once.

  3. Clear caches

    Purge your caching plugin and CDN, then reload and check the Network tab.

Standard GTM snippet (replace GTM-XXXXXXX)html
<!-- 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>
CSP directives that allow GTM (adjust to your policy)text
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

Confirmation checks
  • 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

Prevention habits
  • 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
How an unnoticed break unfolds
  1. Day 0

    A theme update drops the GTM snippet from the landing page template.

  2. Day 1

    Reports show fewer conversions. The page looks normal.

  3. Day 7

    Ad platforms optimise on thin data and results slip.

  4. 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.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: tag_missing.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.