Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Wrong GTM container ID on your site: how to find and fix it

TRK-100High impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

Google Tag Manager (GTM) is a free tool that loads your tracking tags from one place. Each container has an ID that looks like GTM-ABC1234. Your site loads the container through a small snippet that contains this ID.

The problem happens when the ID in the snippet is not the container you think it is. It may be a typo, an old container from a previous agency, a staging container, or one from a different client. You publish changes in the right container, but visitors load the wrong one.

Common causes: copying a snippet from the wrong account, cloning a site or theme that carries the old ID, a plugin setting with an outdated ID, or a redesign that pasted in an old snippet.

Why it costs you leads or sales

Everything you manage in the right container stops working on the live site: GA4, Google Ads conversions, Meta and other pixels. Ad platforms see no conversions, so reports look empty and bidding has nothing to learn from. Your site itself still looks fine, so nobody notices.

If the wrong container belongs to someone else, you may also send your visitors' data into an account you do not control.

What happens with a wrong container ID
  1. Visitor landsPage loads normally
  2. GTM snippet runsLoads GTM-OLD1234 instead of GTM-NEW5678
  3. Your tags fireNever loaded
  4. Conversion recordedAd platforms see nothing

The page loads, but the container that holds your tags never does.

Conversions reported vs. realExample numbers
Conversions reported vs. real (example)Real leads: 40 conversions per week; Reported (correct ID): 38 conversions per week; Reported (wrong ID): 0 conversions per week0153140380Real leadsReported (correct ID)Reported (wrong ID)conversions per week

Example: 40 real leads a week, but the ad platform sees none after the wrong ID goes live.

How to check if your site has it

Compare the installed ID with the one you expect
  1. Find the ID you should be using

    Open tagmanager.google.com, pick your container and read the ID at the top of the workspace (GTM-XXXXXXX). Click it to see the install snippet.

  2. View the page source

    Open your live page, right-click and choose View page source, then search for googletagmanager.com/gtm.js?id= and googletagmanager.com/ns.html?id=.

  3. Compare every match

    Each ID found must match your container. Check the home page, a landing page, the checkout and the thank-you page, as templates can differ.

  4. Use Preview mode

    In GTM click Preview and enter your URL. If Tag Assistant says it cannot connect or finds no container, the page is probably loading another ID.

  5. Check in the browser console

    Type google_tag_manager in the console and press Enter. The object lists the container IDs that loaded.

How to fix it

Replace the wrong ID with the correct one in every place it is installed. Where you do this depends on how GTM was added.

Replace the container ID by platform
  1. Check your GTM plugin

    If you use a plugin such as Site Kit or a GTM plugin, open its settings and correct the container ID field.

  2. Check theme and header code

    Look in Appearance > Theme File Editor (header.php), or in any header and footer scripts plugin, for a hard-coded snippet with the old ID. Remove duplicates.

Correct GTM snippet (replace GTM-XXXXXXX)html
<!-- In <head>, as high as possible -->
<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 the opening <body> tag -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>

How to confirm it's fixed

Confirmation checks
  • View source on the live page shows only your GTM ID, in both the script and the noscript parts
  • Typing google_tag_manager in the console lists your container
  • GTM Preview connects to the live URL and shows your tags
  • GA4 DebugView or Realtime shows the test visit
  • Key tags (conversion, pixels) fire on the thank-you page
  • The ID is correct on the home page, landing pages, checkout and thank-you page

How to prevent it happening again

Prevention habits
  • Keep a record of the correct GTM ID for each site
  • Copy snippets from GTM's install screen instead of typing them
  • Use separate containers for staging and production, and never copy staging code live
  • Check the ID after cloning a site, switching themes or a redesign
  • Remove old agency containers when you hand over a site
  • Re-check the live page source after every release

How FunnelGuard handles this

FunnelGuard detects this issue today. Its check looks at the tag IDs found on your live pages as a robot visitor runs your journeys, and compares them with the IDs you expect. If a different GTM container loads, or yours is missing, you get one alert with a screenshot and a likely cause.

A failure is re-checked from a second region before the alert goes out. Alerts can go to email, Slack, Teams, WhatsApp, webhook or PagerDuty. The Free plan covers 1 site and 2 journeys with daily checks and no card. A free read-only website audit is also available.

Questions people ask

Why is my Google Tag Manager not firing any tags?

A common cause is that the page loads a different container ID than the one you edit. View the page source, search for gtm.js?id= and compare the GTM-XXXXXXX value with your container. If they differ, replace the snippet ID.

How do I find which GTM container is installed on my website?

Open the live page, view the source and search for googletagmanager.com/gtm.js?id=. The ID after id= is the container. You can also type google_tag_manager in the browser console to list loaded containers.

Where do I find my GTM container ID?

Sign in at tagmanager.google.com and open your container. The ID in the format GTM-XXXXXXX shows at the top of the workspace. Click it to see the full install snippet.

How do I change the GTM container ID on my website?

Replace the ID in both the head script and the body noscript, or in the plugin or integration setting that adds them. The place depends on your platform, such as theme.liquid on Shopify or Code Injection on Squarespace. Then publish and clear caches.

Can a wrong GTM ID affect Google Ads conversions?

Yes. If the container that holds your conversion tags never loads, Google Ads receives no conversions from that site. Reports show zero or falling conversions even though leads keep arriving.

Why does GTM Preview mode say it cannot find my container?

Tag Assistant looks for the container you are previewing on that page. If the site loads a different ID, or the snippet is missing, it cannot connect. Check the source for the ID first.

Can I have two GTM containers on one site?

Technically yes, but it often causes duplicate or conflicting tags. If an old container is still installed, move anything you need into your container and remove the old snippet.

How can I be alerted if the GTM ID changes?

A synthetic monitor can load your pages on a schedule and compare the tag IDs found with the ones you expect. FunnelGuard does this and sends an alert with a screenshot when the container is wrong.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: tag_ids.

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.