On this page
What this issue is
Google Tag Manager (GTM) gives you two pieces of code. The main script belongs as high as possible in the <head>. The noscript iframe belongs right after the opening <body> tag. This issue is when the main script has been pasted into the footer, often because a theme, page builder or plugin only offered a footer box.
Why it costs you leads or sales
Late loading creates a window where visitors act but GTM is not there yet. Events in that window are lost, and the ad platforms never hear about them.
- Page starts loadingHead and body content render first
- Visitor clicks or submitsHappens before the footer is reached
- GTM loads lateContainer arrives after the action
- Tags fireListeners missing, event never seen
- Conversion reportedGA4 and ad platforms get nothing
The visitor acts before the footer script has loaded, so the conversion is never reported.
Typical effects: the first page view is missed or recorded after the user left, click triggers on buttons that were pressed early do nothing, and a redirect or quick bounce ends the visit before any tag runs. Slow connections make it worse because the footer script waits behind images and other scripts. Under-reporting makes campaigns look worse than they are and starves ad bidding of conversion data.
Example: illustrative numbers showing how a late snippet can lose more visits on slow connections.
How to check if your site has it
View the page source
Open your page, right-click, choose View page source and search for
googletagmanager.com/gtm.js. Note whether it appears inside<head>near the top or far down near</body>.Check the order in the Network tab
Open DevTools, go to Network, reload and filter for
gtm.js. If it starts after your images and theme scripts, it is loading late.Use Tag Assistant
Open tagassistant.google.com, connect your site and look at the event order. A late Container Loaded or a Page View that arrives long after the page rendered points to this issue.
Check the noscript part
Search the source for
ns.html?id=GTM-. It should sit directly after the opening<body>tag.
How to fix it
The goal is the standard placement from Google. Remove the footer copy first, so you do not end up with two containers loading and counting events twice.
<!-- 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) -->Remove the footer copy
Check the theme's footer scripts box, any header and footer plugin set to footer, and footer.php if you edited it.
Add it to the head
Use a GTM plugin or a header scripts plugin set to Header, or add the code in a child theme's functions.php with the wp_head hook. Use wp_body_open for the noscript part if your theme supports it.
Edit theme.liquid
In Online Store, Themes, Edit code, open layout/theme.liquid. Delete the snippet near </body>.
Paste in the right places
Put the script high inside <head> and the noscript right after <body>. Note that checkout pages may need separate setup depending on your plan.
Clear the footer code
In Site settings, Custom code, remove the GTM code from the Footer code box.
Use the head box
Paste the main script into Head code. Webflow has no body-start box, so many sites keep only the script, which covers most visitors.
Move the tracking code
In the funnel or website Settings, Tracking Code, move the GTM script from the Footer Tracking Code to the Header Tracking Code. Repeat for each funnel or site.
Use the Google Tag Manager integration
In Marketing integrations, connect GTM, or in Custom Code set the script to Head and the load option to load on every page. Remove any version set to Body - end.
Switch from footer to header
In Settings, Advanced, Code Injection, move the script from the Footer box to the Header box. Code injection requires a plan that supports it.
Edit the shared layout
Open your base template, delete the script before </body>, and add the two snippets above in the head and after <body>. Deploy and clear any CDN cache.
Footer
- Script sits just before </body>
- Container loads after content and other scripts
- Fast clicks and early page views missed
Head
- Script near the top of <head>
- Container starts loading early and async
- Noscript right after <body>
How to confirm it's fixed
- View source shows gtm.js inside <head>, near the top
- The ns.html iframe appears right after <body>
- The container ID appears only once on the page
- Tag Assistant shows Container Loaded before the page view tags
- In GTM Preview, tags that use Page View or Initialization triggers fire on first load
- Test conversions appear in GA4 DebugView or the ad platform's test tool
How to prevent it happening again
Placement often changes when someone swaps a theme, installs a plugin or rebuilds a template. Keep the GTM code in one documented place, such as the base layout, and note it in your launch checklist. After any theme or plugin change, view the source and search for the container ID. Give only one person or tool ownership of the snippet, so no one adds a second copy.
How FunnelGuard handles this
FunnelGuard does not check snippet placement yet. It is a possible future check. Today, a FunnelGuard robot visitor runs your real journeys on a schedule and checks that the tracking hits to GA4, Google Ads, Meta and other platforms actually arrive, so a late or missing GTM load that loses conversions can show up as a missing hit, but it will not tell you the cause is the footer position.
To watch for this yourself, view the page source after every theme, plugin or template change and confirm the container sits in the head. You can also re-run Tag Assistant on your key pages now and then, and compare GA4 conversions against form or order counts in your own system. A free read-only website audit is also available from FunnelGuard.
Questions people ask
Can I put the Google Tag Manager code in the footer?
It works, but Google recommends the main script as high in the head as possible. In the footer it loads after most of the page, so quick clicks, early page views and fast exits can be missed. Move it to the head when your platform allows.
Why is my GTM firing late?
The most common cause is the snippet sitting in the footer or being injected by a plugin after other scripts. Heavy pages and slow connections make the delay longer. Check where gtm.js appears in the page source and in the Network tab.
Where exactly should the GTM noscript go?
Place the noscript iframe immediately after the opening body tag. It is a fallback for visitors with JavaScript disabled. Putting it in the head is a different issue, as iframes are not valid there.
Will moving GTM to the head fix missing conversions?
It fixes conversions lost because GTM loaded too late. It will not fix wrong triggers, paused tags, consent blocking or a wrong container ID. Test in Preview mode after the move to see which tags now fire.
How do I check where my GTM snippet is placed?
View the page source and search for googletagmanager.com/gtm.js, then see whether it sits inside the head near the top. You can also use the Network tab in browser DevTools to see when gtm.js starts loading.
Does the GTM footer placement slow down my site?
Not really. The snippet loads asynchronously either way. The head placement lets the container start downloading earlier without blocking rendering, so it is mainly a tracking accuracy matter, not a speed one.
Can I use a tag manager plugin instead of editing code?
Yes on platforms like WordPress, where a plugin can output the snippet in the head and body. Check its settings for a footer option and make sure only one method adds the container.
Does FunnelGuard detect a GTM snippet in the footer?
Not yet. It is a possible future check. FunnelGuard does run your real journeys and check tracking hits arrive, which helps you notice lost conversions, but placement itself you check in page source.
Related issues
- TRK-099GTM container snippet missingFix guide
- TRK-101Two GTM containers fighting (old agency + new)Fix guide
- TRK-104GTM noscript iframe in head instead of bodyFix guide
- TRK-100Wrong GTM container ID on siteFix guide
- TRK-103Workspace changes never published (tag in preview only)Fix guide
- TRK-116Tag firing in preview but blocked by consent settings in liveFix guide