Skip to content
FunnelGuard

Fix guide by FunnelsGuard

GTM loaded twice from the same ID: how to find and fix it

TRK-127Medium impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

Google Tag Manager (GTM) is a container that holds your tracking tags. You install it by adding a small snippet with your container ID, like GTM-XXXXXXX, to your pages. GTM loaded twice from the same ID means that snippet runs two times on one page.

It usually happens by accident. A developer pastes the snippet into the theme, and later a plugin or a page builder adds it again. Or an agency adds it to the header, and the site owner adds it in a settings box. Each copy loads the same container, so each tag runs twice.

Why it costs you leads or sales

Doubled tags send doubled data. A purchase or lead event can reach GA4, Google Ads, Meta or TikTok two times. Reports look better than reality, and you make decisions on numbers that are wrong.

The damage is quiet. Nothing looks broken to a visitor. But the effects are real:

What double loading can cause
  • Conversions counted twice in Google Ads, which can mislead automated bidding
  • Inflated page views and event counts in GA4, and a distorted bounce or engagement picture
  • Duplicate Meta or TikTok events, which hurt matching and optimisation
  • Cost per lead looking about half of what it really is
  • Slower pages, because the container script and its tags run twice
How one lead becomes two
  1. Visitor submits formOne real lead
  2. Thank-you page loadsPage contains the GTM snippet twice
  3. Container runs twiceEvery tag fires two times
  4. Ad platform receives 2 conversionsReports and bidding use wrong data

The duplicate snippet turns a single thank-you page view into two conversion hits.

Reported vs real leadsExample numbers
Reported vs real leads (example)Real leads: 50 leads; Reported conversions: 100 leads0387750100Real leadsReported conversionsleads

Example: with a duplicate snippet, 50 real leads can show as 100 conversions in an ad platform.

How to check if your site has it

Three quick ways to spot a duplicate
  1. Search the page source

    Open your page, right-click, choose View page source, and search for your container ID (GTM-XXXXXXX). You should see it in the head script and in the noscript iframe, which is two mentions. If you see two head scripts, or the ID in several places beyond that, you have a duplicate.

  2. Check the Network tab

    Open DevTools (F12), go to Network, filter by gtm.js, and reload. Two requests to googletagmanager.com/gtm.js?id=GTM-XXXXXXX with the same ID mean a double load.

  3. Use GTM Preview

    Open Tag Assistant from your GTM workspace with Preview. If a tag shows as fired twice on the same event, or the same container appears twice, the snippet is duplicated.

  4. Run a console check

    In the browser console, run the snippet below. It lists every GTM script on the page.

List GTM scripts on the pagejavascript
const scripts = [...document.querySelectorAll('script[src*="googletagmanager.com/gtm.js"]')].map(s => s.src);
console.log(scripts.length + ' GTM script tag(s):', scripts);
console.log('Containers registered:', Object.keys(window.google_tag_manager || {}));

How to fix it

The fix is the same everywhere: find every place that adds the snippet, keep one, and remove the others. Where you look depends on your platform.

Remove the duplicate snippet
  1. Check the theme

    Look in Appearance > Theme File Editor (or your child theme) at header.php and footer.php for a GTM snippet. Many themes also have a Header Scripts or Tracking Code box in their options.

  2. Check plugins

    Plugins such as Google Site Kit, GTM4WP, header and footer script plugins, SEO plugins and page builders can each add the snippet. Keep it in one of them only.

  3. Remove extras and clear caches

    Delete the extra copy, then clear your caching plugin and CDN so visitors get the updated page.

The correct pattern: each part oncehtml
<!-- In <head>, once -->
<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>

<!-- Straight after opening <body>, once -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
Page source before and after

Duplicate

  • Snippet in the theme header and again in a plugin
  • Two gtm.js requests for the same ID
  • Each conversion tag fires twice

Fixed

  • One snippet in a single place
  • One gtm.js request per page
  • Each tag fires once per event

How to confirm it's fixed

Verify the fix
  1. Clear caches

    Purge the page cache, CDN cache and your browser cache so you see the live version.

  2. Reload with Network open

    Filter by gtm.js. You should see one request for your container ID.

  3. Re-run the console check

    The script count should be 1.

  4. Test a conversion

    Submit a test form in GTM Preview and confirm each conversion tag fires once. Then check GA4 DebugView or your ad platform's test events tool for a single event.

How to prevent it happening again

Habits that stop duplicates
  • Decide who owns the GTM install and where it lives (theme, plugin or code), and write it down
  • Before adding a plugin, app or integration that offers GTM, check whether the snippet already exists
  • After any theme change, redesign or migration, re-check the page source for the container ID
  • Give agencies and developers a rule: remove the old install before adding a new one
  • Check the Network tab for a single gtm.js request after each release

How FunnelGuard handles this

FunnelGuard detects this issue today. Its robot visitor runs your real customer journeys on a schedule and checks the tracking on each step. When it sees the same GTM container ID loaded more than once on a page, it flags it as a duplicate.

If a check fails, it 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. FunnelGuard reports the duplicate; you still remove the extra snippet yourself using the steps above. The Free plan covers 1 site and 2 journeys with daily checks and no card, and paid plans include a 3-day free trial.

What it looks like over time

How a duplicate usually appears
  1. Day 1

    Developer adds the GTM snippet to the theme

  2. Month 3

    A marketing plugin is installed and its GTM field is filled in with the same ID

  3. Month 3

    Conversions and page views jump, which looks like good news

  4. Month 4

    Ad platforms optimise on inflated data and cost per lead looks too low

  5. After fix

    One snippet is removed and numbers return to real levels

One page, two loads

The same container loads twice, so each tag runs twice for one visit.

Questions people ask

Why is my GTM container loading twice?

The same snippet is usually added in two places, such as the theme header and a plugin, an app, a page builder box or a custom code field. Search your page source and settings for the container ID and remove all but one copy.

How do I check if Google Tag Manager is installed twice?

Open DevTools, go to the Network tab, filter by gtm.js and reload the page. Two requests with the same GTM ID mean it loads twice. You can also search the page source for the ID and look for two script snippets.

Does having GTM twice double my conversions?

Yes, it often does. Each copy runs the same container, so each tag fires twice, and a conversion can reach GA4, Google Ads or Meta two times. Counts and cost per lead then look better than they really are.

Is the GTM noscript tag a duplicate?

No. The noscript iframe is meant to appear once in the body, as a fallback for visitors without JavaScript. The problem is two script snippets with the same container ID.

Why are my GA4 page views doubled?

A common cause is GTM loading twice with a GA4 tag inside it. Another is a GA4 tag in GTM plus a hard-coded gtag.js on the page. Check the Network tab for repeated gtm.js or repeated collect requests.

Can GTM load itself twice from inside the container?

Yes. A Custom HTML tag that contains the GTM snippet makes the container load again. Search your workspace for googletagmanager.com/gtm.js in tag code, pause or delete that tag and publish.

How do I stop duplicate GTM installs coming back?

Pick one place to own the snippet and document it. After theme changes, plugin installs or migrations, check the page source and Network tab again. A scheduled monitor like FunnelGuard can also flag a repeat.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: duplicates.

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.