Skip to content
FunnelGuard

Fix guide by FunnelsGuard

GTM container snippet missing: how to find and fix it

TRK-099High impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

Google Tag Manager (GTM) is a tool that lets you manage tracking tags from one place. It only works if your website loads the container, a bundle of your tags, through a snippet of code. The snippet has two parts: a script placed as high as possible in the <head>, and a <noscript> iframe placed right after the opening <body> tag.

Why it costs you leads or sales

With no container, no tags run. Page views, form submits and purchases go unrecorded in GA4. Google Ads and Meta stop receiving conversions, so their bidding has less data to learn from and your reports show leads dropping even when real people are still converting. Retargeting audiences also stop filling.

What happens when the snippet is missing
  1. Visitor landsPage loads normally
  2. GTM snippetNot in the page code
  3. Tags fireGA4, Ads, Meta never run
  4. Platforms receive dataNo conversions recorded

The page loads fine for visitors, so the break is easy to miss.

Conversions recorded in your ad platformExample numbers
Conversions recorded in your ad platform (example)Week before: 42 conversions per week; Week of change: 18 conversions per week; Week after: 0 conversions per week0163242180Week beforeWeek of changeWeek afterconversions per week

Example: illustrative numbers for a site with steady traffic that loses its GTM snippet after a theme update.

How to check if your site has it

Check for the GTM snippet
  1. View the page source

    Open your key page, right-click and choose View page source. Search (Ctrl+F or Cmd+F) for googletagmanager.com/gtm.js and for your container ID, which looks like GTM-XXXXXXX.

  2. Check the Network tab

    Open browser developer tools, go to Network, reload and filter for gtm.js. You should see a request with id=GTM-XXXXXXX and a 200 status.

  3. Use Tag Assistant

    Go to tagassistant.google.com, enter the page URL and connect. It reports whether the container was found.

  4. Test every page type

    Check the home page, a landing page, the form page, the thank-you page and checkout. The snippet is often missing on only one template.

How to fix it

First copy your snippet. In GTM, click your container ID at the top of the workspace (Workspace tab) to open Install Google Tag Manager. It shows both code parts with your real ID.

Part 1: as high as possible in the <head>html
<!-- Google Tag Manager -->
<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>
<!-- End Google Tag Manager -->
Part 2: right after the opening <body> taghtml
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
Add the snippet on your platform
  1. Use a header and footer code tool

    Install a GTM plugin (for example the official Google Site Kit or a GTM plugin) or a header scripts plugin, and paste your container ID or both code parts. Exact menu names depend on the plugin.

  2. Or edit the theme

    Use a child theme. Add part 1 in header.php before </head> and part 2 right after <body> using wp_body_open() support. Parent theme edits are lost on update.

After pasting the code
  1. Check the ID

    Make sure the container ID matches the one in your GTM account exactly.

  2. Clear caches

    Purge page cache, CDN and minification caches so visitors get the new code.

  3. Publish the container

    In GTM, confirm your tags are in a published version, not only in a workspace or preview.

How to confirm it's fixed

Confirmation checks
  • View source shows GTM-XXXXXXX in the head and in the noscript iframe
  • Network tab shows gtm.js?id=GTM-XXXXXXX with status 200
  • Tag Assistant connects and lists your tags as fired
  • GTM Preview mode shows the container loaded on the home, form, thank-you and checkout pages
  • GA4 Realtime or DebugView shows your own visit
  • Ad platform test tools show the conversion event arriving

How to prevent it happening again

Prevention habits
  • Put the snippet in a shared layout or one central setting, not on single pages
  • Re-check GTM after theme changes, plugin updates, redesigns and migrations
  • Keep the snippet in the child theme or a plugin so updates do not overwrite it
  • Record who owns the container and where the snippet lives
  • Check new landing pages built in other tools as soon as they go live
  • Set up automated monitoring so a missing snippet is caught the same day
How it usually unfolds
  1. Day 0

    A theme update or redesign goes live and the snippet is dropped.

  2. Day 1-3

    Nothing looks wrong on the site. Reports start to dip.

  3. Week 2

    Someone notices conversions are near zero in GA4 and Ads.

  4. Fix day

    Snippet is restored and tracking resumes, but the gap in data stays.

How FunnelGuard handles this

FunnelGuard detects this today. A robot visitor loads your real 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 expected hits do not arrive because the container is not loading, the check fails. 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 visits are marked (utm_source=funnelguard, fg_test=1, an fg_test cookie and their own user agent) and never click real ads. The Free plan covers 1 site and 2 journeys with daily checks and no card. Paid plans have a 3-day free trial, and a free read-only website audit is also available.

Questions people ask

Why is my Google Tag Manager not loading on my website?

The most common reason is that the container snippet is not in the page code. It can be removed by a theme change, a plugin update or a new template. Check View page source for googletagmanager.com/gtm.js and your GTM- ID, then restore the snippet in the shared layout.

How do I check if the GTM container is installed?

Open your page, view the source and search for your GTM-XXXXXXX ID. You can also look for a gtm.js request in the browser Network tab, or connect the page in Google Tag Assistant. Test several page types, not only the home page.

Where should the GTM snippet go on the page?

The script part goes as high as possible in the <head>. The <noscript> iframe goes immediately after the opening <body> tag. Both should come from a template that every page shares.

Why are my GTM tags not firing even though they are published?

If the container itself is not loaded, no tag can fire, however well it is set up. Confirm gtm.js loads with your container ID first. If it does, look at triggers, consent settings and whether the right version is published.

Does a missing GTM snippet affect Google Ads and Meta conversions?

Yes. If the tags live in GTM, no container means no conversion hits are sent. Ad platforms then see fewer or zero conversions, which can reduce optimisation quality and make reports look worse than reality.

Can I install GTM on only some pages by mistake?

Yes. This often happens when the code is pasted into individual pages, or when funnel and landing page tools have their own tracking settings. Put the snippet in a shared layout and check each page type, including thank-you pages.

Do I need the noscript part of the GTM snippet?

Google asks for both parts. The noscript iframe is a fallback for browsers with JavaScript off, which is rare, but including it follows Google's install instructions. The script in the head is the part that matters most for tracking.

How can I be alerted if the GTM snippet disappears again?

Use synthetic monitoring that visits your pages on a schedule and checks that tracking hits arrive. FunnelGuard does this and sends one alert with a screenshot and a likely cause after re-checking from a second region.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

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.