On this page
What this issue is
A single-page app (built with React, Vue, Angular, Next.js and similar tools) changes the page content without a full browser reload. Analytics tools therefore need to be told when a new "page" has been viewed. Double page_view means that, on one route change, two page_view events are sent to GA4 or another platform.
| Source | What it does | Typical clash |
|---|---|---|
| GA4 enhanced measurement (Page changes based on browser history events) | Sends page_view on history pushState changes | Plus a manual gtag('event','page_view') in the router |
| GTM History Change trigger | Fires a GA4 event tag on each history change | Plus enhanced measurement or a custom event tag |
| Router hook in code (useEffect on location) | Sends page_view on each route | Runs twice in React Strict Mode in development, or on re-renders |
| Config tag with send_page_view left on | Sends page_view on load | Plus a manual page_view on the first route |
| Meta Pixel PageView in route hook | Sends PageView per route | Plus a base pixel or a GTM tag firing on history change |
Why it costs you leads or sales
Duplicate page views do not stop a form or checkout working, so the damage is quieter. Page views, sessions per user and engagement numbers are inflated. Bounce and engagement rates look better than they are. Conversion rates built on page views look lower. Audiences and retargeting lists that depend on page views fill with the wrong signals.
Example: 1,000 real route views are reported as 2,000 when every route sends two page_view events.
- User clicks a linkRouter updates the URL without reload
- Automatic history trackingSends page_view #1
- Manual page_view in codeSends page_view #2
- ReportsPage views and sessions inflated
Both the automatic listener and your own code report the same navigation.
How to check if your site has it
Open the browser Network tab
In Chrome, press F12, open Network and filter for
collect(GA4) orfacebook.com/tr(Meta Pixel). Click through to another route in your app without reloading.Count the hits per navigation
For GA4, look at the
en=page_viewparameter in each collect request. Two requests withen=page_viewfor one navigation means a duplicate. Compare thedl(page location) values too.Use GA4 DebugView
Turn on debug mode with the Google Analytics Debugger extension or GTM Preview, then open Admin > DebugView. Navigate one route and see if page_view appears twice in the stream.
Use GTM PreviewGoogle Tag Manager
In Tag Assistant, navigate one route and see which tags fired on each History Change or custom event. Two GA4 event tags with page_view on the same event are the clue.
Check enhanced measurement
In GA4 go to Admin > Data streams > your web stream > Enhanced measurement > gear icon, and see whether Page changes based on browser history events is on.
How to fix it
The rule is simple: one navigation, one page_view, from one source. Decide which source owns it, then switch off the others.
Pick the owner
Either let GA4 enhanced measurement send route page views, or send them yourself from the router or GTM. Do not do both.
Remove or disable the extras
If you track in code or GTM, turn off Page changes based on browser history events in enhanced measurement. If you rely on enhanced measurement, delete the manual page_view and any GTM History Change page_view tag.
Stop the initial load double
If your router hook also fires on first load, either set
send_page_view: falsein the config and let the hook send every page_view, or skip the hook on first render.Apply the same rule to other platforms
Check Meta Pixel, TikTok, LinkedIn and others for the same pattern: a base snippet that fires PageView on load plus a route hook or GTM trigger.
Publish and retest
Deploy, clear cache, and repeat the Network tab check on the live site.
Turn off automatic page_view on config
Set
send_page_view: falsein your gtag config so only your router hook sends page views.Send one page_view per route
Use one hook that runs on route change (see the snippet below). Remove any other page_view calls.
Turn off history tracking in GA4
In GA4 Admin > Data streams > Enhanced measurement > gear icon, switch off Page changes based on browser history events if your code sends the page_view.
Find the duplicate tags
In Tags, look for two GA4 Event tags named page_view, or a GA4 Configuration tag that sends page views plus an event tag on History Change.
Keep one trigger
Use either a History Change trigger or a custom event your app pushes to the dataLayer. Remove the other tag.
Check enhanced measurement
If GTM sends the page_view, switch off history-based page changes in the GA4 stream settings.
Check for two tracking sources
If you use a headless or SPA-style theme, look for both a plugin (such as a Google Analytics plugin) and a GTM container sending page views. Disable one.
Review plugin settings
Settings vary by plugin. Look for options about page view tracking on route or history changes and turn off the duplicate.
Check custom code
In Site settings > Custom code and in page-level code, look for a manual page_view in addition to the GA4 or GTM setup. Remove the extra one and publish.
Check Marketing integrations
If you connected Google Analytics in Wix and also added a custom tracking snippet or GTM, you may send page views twice. Keep one.
// In index.html or your gtag setup:
// gtag('config', 'G-XXXXXXXXXX', { send_page_view: false });
import { useEffect } from 'react';
import { useLocation } from 'react-router-dom';
export function PageViewTracker() {
const location = useLocation();
useEffect(() => {
window.gtag('event', 'page_view', {
page_location: window.location.href,
page_path: location.pathname + location.search,
page_title: document.title
});
}, [location.pathname, location.search]);
return null;
}Before
- Enhanced measurement history tracking is on
- Router hook also sends page_view
- Two page_view hits per navigation
After
- One source owns page_view
- Other sources are switched off
- One page_view hit per navigation
How to confirm it's fixed
- On the live site, navigating to a new route sends exactly one
en=page_viewrequest - The first page load also sends one page_view, not two
- GA4 DebugView shows one page_view per navigation
- GTM Preview shows one page_view tag firing per route event
- Meta Pixel Helper (or the Network tab) shows one PageView per route
- Over the next few days, page views per session look closer to real browsing
How to prevent it happening again
- Write down which system owns page_view (enhanced measurement, GTM or code)
- Review analytics setup whenever you add a plugin, change router, upgrade framework or move to GTM
- Test route changes in a staging build with the Network tab before release
- Keep one GA4 config per page
- Re-check after changes to enhanced measurement settings
How FunnelGuard handles this
FunnelGuard detects this issue today. A robot visitor runs your real customer journeys on a schedule, from the EU or the US, and checks the tracking hits sent to GA4, Meta and other ad and analytics platforms at each step. When a single navigation sends the same page_view hit twice, that shows up in the step's tracking check.
Questions people ask
Why is my SPA sending page_view twice in GA4?
Usually two things report the same navigation: GA4 enhanced measurement (Page changes based on browser history events) and your own page_view code or GTM tag. Pick one source and turn the other off.
How do I stop GA4 counting page views twice in React?
Set send_page_view: false in your gtag config and send one page_view from a router hook, or rely on enhanced measurement alone and remove manual calls. Then turn off history-based tracking in the data stream if your code owns it.
Should I turn off enhanced measurement page changes in GA4?
Turn it off if you send page_view yourself from code or GTM. Leave it on only if nothing else sends route page views. Retest afterwards so you do not end up with none.
Why do I see two page_view events only on my local machine?
React Strict Mode runs effects twice in development, which can send a duplicate. Check the deployed site before changing your setup.
How do I check for duplicate page_view events in GTM?
Open Preview mode, navigate one route and look at which tags fired. If two GA4 event tags named page_view fire on the same History Change or custom event, remove one.
Does a double page_view affect Meta Pixel too?
It can. If a base pixel, a route hook and a GTM tag all send PageView, Meta receives duplicates. Check with Meta Pixel Helper or the Network tab and keep one source.
Can FunnelGuard tell me if my page_view fires twice?
Yes. FunnelGuard runs your journeys with a robot visitor and checks the tracking hits sent at each step, and it detects a duplicate page_view hit. You then get one alert with a screenshot and a likely cause.
Related issues
- TRK-389SPA route change sends no page_viewFix guide
- TRK-391Next.js/React hydration error stops tagsFix guide
- TRK-392Headless checkout loses tracking from main siteFix guide
- TRK-400Tracking only in site header, funnel pages use blank templateFix guide
- TRK-404Service worker caches old page with old tagsFix guide
- TRK-393Shopify checkout extensibility removed checkout.liquid scriptsFix guide