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.
- Visitor landsPage loads normally
- GTM snippetNot in the page code
- Tags fireGA4, Ads, Meta never run
- Platforms receive dataNo conversions recorded
The page loads fine for visitors, so the break is easy to miss.
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
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.jsand for your container ID, which looks likeGTM-XXXXXXX.Check the Network tab
Open browser developer tools, go to Network, reload and filter for
gtm.js. You should see a request withid=GTM-XXXXXXXand a 200 status.Use Tag Assistant
Go to tagassistant.google.com, enter the page URL and connect. It reports whether the container was found.
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.
<!-- 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 --><!-- 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) -->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.
Or edit the theme
Use a child theme. Add part 1 in header.php before
</head>and part 2 right after<body>usingwp_body_open()support. Parent theme edits are lost on update.
Edit theme.liquid
Go to Online Store > Themes > Edit code and open
layout/theme.liquid. Paste part 1 high in<head>and part 2 right after<body>.Checkout pages
Checkout and thank-you pages are not covered by theme.liquid. Use Settings > Customer events (custom pixel) as your plan allows, or check Shopify's current options for your plan.
Use custom code
Go to Project settings > Custom code. Paste part 1 into Head code and part 2 at the start of Footer code is not ideal, so use a Embed element just inside the body if you need the noscript. Then publish the site.
Use the Google Tag Manager integration
Go to Settings > Marketing integrations > Google Tag Manager (menu names can change) and connect your container ID. Or add custom code under Settings > Custom code. A paid plan with a connected domain is needed.
Code injection
Go to Settings > Advanced > Code Injection and paste part 1 into Header. Code injection is available on paid plans. Part 2 can go in the Header too if body injection is not offered, though it is only a fallback.
Add tracking code per site or funnel
In the funnel or website settings, open Tracking Code and paste part 1 into Head Tracking Code and part 2 into Body Tracking Code. Save and republish each funnel, as settings are per funnel.
Put it in the shared layout
Add both parts to the base template or layout that every page uses, not to individual pages. Deploy and clear any CDN or page cache.
Check the ID
Make sure the container ID matches the one in your GTM account exactly.
Clear caches
Purge page cache, CDN and minification caches so visitors get the new code.
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
- View source shows
GTM-XXXXXXXin the head and in the noscript iframe - Network tab shows
gtm.js?id=GTM-XXXXXXXwith 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
- 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
Day 0
A theme update or redesign goes live and the snippet is dropped.
Day 1-3
Nothing looks wrong on the site. Reports start to dip.
Week 2
Someone notices conversions are near zero in GA4 and Ads.
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.
Related issues
- TRK-100Wrong GTM container ID on siteFix guide
- TRK-101Two GTM containers fighting (old agency + new)Fix guide
- TRK-104GTM noscript iframe in head instead of bodyFix guide
- TRK-105GTM snippet placed in footer, firing lateFix guide
- TRK-103Workspace changes never published (tag in preview only)Fix guide
- TRK-111Tag paused in GTMFix guide