Duplicate GA4 Page Views From gtag.js and GTM: How to Fix

Quick fix: Open your site with the browser's Network tab filtered to collect and count the page_view hits on a single page load. If you see two, your Google tag is installed twice, usually once hard-coded and once through GTM or a plugin. Pick one installation method, remove the others, and re-test.

Double counting is one of the quietest tracking problems. Nothing looks broken, the tags all fire, and reports fill with data. The numbers are just wrong: page views per session look inflated, conversion counts sit well above your real orders, and bidding strategies learn from conversions that never happened.

The usual cause is simple. Over a site's life, someone pastes the gtag.js snippet into the theme, someone else adds Google Tag Manager, and a third person installs a CMS plugin that also adds Google Analytics. Each one works on its own. Together they send every hit twice.

How duplicate Google tags happen

These are the patterns that cause most double counting, ordered from most to least common.

Hard-coded gtag.js plus a Google tag in GTM

The theme contains the standard snippet with gtag('config', 'G-XXXXXXXXXX'), and GTM also has a Google tag with the same ID firing on all pages. Google's page view documentation explains that the config command sends a page view by default. Two config paths means two page views.

A CMS or ecommerce plugin plus a manual install

WordPress plugins, Shopify's Google app, and many theme settings panels can add the Google tag for you. If you also added it manually or through GTM, you now have two. On Shopify, Google's own guide to removing duplicate tags after connecting the Google & YouTube app lists the places old tags tend to hide: theme.liquid, custom pixels under Settings > Customer events, and older checkout scripts.

Manual page views on top of automatic ones

A developer adds a GA4 event tag named page_view in GTM, or calls gtag('event', 'page_view') in code, without turning off the automatic page view. Google warns that sending manual page views without disabling page view measurement may cause duplicates.

Single-page apps make this worse. Enhanced measurement can send page views on browser history changes, and Google notes that this still happens even if you set send_page_view: false. If your router code also sends a virtual page view on every route change, each navigation counts twice. See our guide to tracking route changes in single-page apps for the full setup.

Conversion tags installed twice

The same problem hits Google Ads. A hard-coded event snippet on the thank-you page and a Google Ads Conversion Tracking tag in GTM both fire for the same conversion action. Google Ads counts both unless they share a transaction ID. If this is your situation, also read our Google Ads conversion troubleshooting guide, because cleaning up duplicates often reveals other gaps.

Two GTM containers that both load GA4

Agencies sometimes add their own container next to the client's. If both contain a Google tag for the same measurement ID, you get the same duplication as above, just harder to spot.

Step 1: Count the hits on one page load

Start with evidence, not guesses.

  1. Open the page in a clean browser window with no ad blocker, and accept the cookie banner.
  2. Open developer tools, go to the Network tab, and filter for collect.
  3. Reload the page once.
  4. Count the requests to /g/collect where the en parameter is page_view and tid is your measurement ID.

One request per load is correct. Two or more for the same tid confirms duplication. If you see page views for two different measurement IDs, that may be intentional (for example, sending to a second property), so check before removing anything.

Repeat the test on a conversion page. For Google Ads, filter for googleadservices or conversion and check whether the same conversion label appears in more than one request.

Step 2: Find every place the tag is installed

Now find where each copy comes from. View the page source (not the rendered DOM) and search for these strings:

  • googletagmanager.com/gtag/js, which is the gtag.js loader
  • gtag('config', which is a config command
  • GTM-, which is a Tag Manager container ID
  • G- and AW-, which are GA4 and Google Ads IDs

A gtag.js loader in the page source alongside a GTM container that also contains a Google tag for the same ID is the classic double install. If the source looks clean but the duplicates remain, the second copy is being injected by a plugin, an app, or a tag inside GTM itself.

Tag Assistant helps here. Connect to your site at tagassistant.google.com and look at the list of tags it found at the top of the session. If the same Google tag ID appears with more than one configuration, or both a container and a standalone Google tag load the same ID, you have found your duplicate. You can also use the Pixel Helper extension to list the tags and events that fire on each page.

Then open GTM and check:

  • How many Google tags exist for the same measurement ID, and what triggers they use
  • Whether any GA4 event tag sends an event named page_view
  • Whether a Custom HTML tag contains a pasted gtag.js snippet

Step 3: Choose one installation method and remove the rest

There is no single right answer, but there must be only one answer per site. Here is how to decide:

If you...KeepRemove
Already manage other tags in GTMThe Google tag in GTMHard-coded gtag.js and plugin tracking
Rely on a platform integration for ecommerce eventsThe platform integrationManual gtag.js and GTM tags for the same ID
Have a small site with no GTM and a developerHard-coded gtag.jsPlugin tracking and any unused GTM container

When you remove a copy, remove all of it: the loader script, the config call, and any event calls that depend on it. If you delete only the loader, leftover gtag() calls will push into a dataLayer that GTM may then pick up in unexpected ways.

If you disable tracking in a plugin, look for a specific setting such as "Insert tracking code" or "Enable Google Analytics". Deactivating the whole plugin can also remove features you need, like a Search Console connection.

Do not remove a duplicate tag right before a busy sales period without testing. If the copy you keep is the one that sends ecommerce events, removing the other is safe. If you guess wrong, you can lose purchase tracking entirely. Test on a staging site or a low-traffic window first.

Step 4: Fix intentional manual page views

If you need to send page views manually, for example in a single-page app, turn off the automatic ones so only your manual hit counts:

gtag('config', 'G-XXXXXXXXXX', { send_page_view: false });

In GTM, set the send_page_view configuration parameter to false on the Google tag. Then, in your GA4 web stream's enhanced measurement settings, turn off page views based on browser history events if your own code already handles route changes.

A safety net: ignore duplicate on-page configuration

GA4 has a setting called Ignore duplicate instances of on-page configuration, found in Admin in the Google tag management area. According to Google's documentation, when the same Google tag is configured more than once on a page, only the first config command is processed and later ones are ignored.

Treat this as a backstop, not a fix. It addresses repeated on-page config commands, it can change behavior if your copies use different settings, and it does nothing for duplicate event calls or duplicate Google Ads conversion tags. Removing the extra installation is still the real solution.

How to verify the fix

  1. Repeat the Network tab test on your home page, a product or content page, and the conversion page. You should see exactly one page_view per load for each measurement ID.
  2. On the conversion page, confirm each conversion label or purchase event fires once.
  3. In GA4 Realtime, trigger a few page views in one session and check the count matches what you did.
  4. For the next week, compare GA4 purchases and Google Ads conversions against your actual orders. They will not match exactly, but they should no longer be close to double.

Remember that historical data will stay inflated. Write down the date of the fix in your team's change log or reporting notes, so nobody mistakes the drop in page views for a traffic problem.

FAQ

Is it bad to have both gtag.js and GTM on the same page?

Not by itself. GTM loads its own copy of the Google tag, and some sites legitimately use gtag.js for one product and GTM for another. It becomes a problem when both configure the same measurement ID or fire the same conversion.

Why did my page views drop after I removed a tag?

If page views drop by roughly half and sessions stay about the same, you were double counting before. That drop is the fix working. If sessions also fall sharply, you may have removed the only working copy, so re-test right away.

Will a transaction ID stop duplicate purchases?

For GA4 web streams, purchase events with the same transaction_id are deduplicated, and Google Ads drops duplicate conversions with the same transaction ID for the same conversion action. It does not fix duplicate page views. Our GA4 purchase duplicates guide covers this in detail.

Can I fix duplicates without editing code?

Sometimes. If the extra copy comes from a plugin setting or a GTM tag, you can remove it from those interfaces. If it is hard-coded in the theme, someone has to edit the theme files.