On this page
What this issue is
A single-page app (built with React, Vue, Angular, Next.js and similar) loads one HTML page, then swaps content in JavaScript when you click a link. The address bar changes, but the browser never reloads.
Standard tracking snippets send a page_view when the page loads. In an SPA that happens once. Every later route change, such as /pricing or /checkout, sends no page_view unless you add code or a trigger for it.
- Landing pageFull load, page_view sent
- Route change to /pricingNo reload, no page_view
- Route change to /checkoutNot recorded
- Thank-you routeConversion tags may never fire
Only the first load fires a page_view. Later routes are invisible to analytics and ad platforms.
Why it costs you leads or sales
Reports show a single page per visit, so engagement looks like a bounce. Funnel reports, paths and goals based on page views stop working. Any conversion tag triggered by a page view or URL match (for example a /thank-you rule) never fires.
Ad platforms then receive fewer signals. Google Ads, Meta and others can't learn from conversions they never see, and you may cut budget from campaigns that are working.
Example: a visitor views 5 routes. With the issue, analytics records 1. After the fix it records 5.
The URL changes, but no tracking request leaves the browser.
How to check if your site has it
Open DevTools Network
Press F12, open the Network tab and filter by
collect(GA4) ortr(Meta Pixel). Turn on Preserve log.Load the first page
You should see a GA4 request with
en=page_view.Click through the site
Use the site's own links, not the browser reload. Watch for a new request on each route.
Compare with DebugView
In GA4 go to Admin > DebugView, or use GTM Preview mode. A missing page_view on later routes confirms the issue.
How to fix it
Pick the method that matches your setup. Use only one method per tag, or you will create duplicate page views (see TRK-390).
Add a History Change trigger
Go to Triggers > New > History Change. Save it as 'History Change - All'.
Attach it to your tags
Add the trigger to your GA4 event tag (event name page_view) and to Meta, TikTok or other page view tags. Keep the original All Pages trigger for the first load only if your GA4 config tag does not already send it.
Turn off automatic page_view if needed
If the GA4 configuration tag also sends page_view on load and on history change, you may get doubles. Check in Preview mode.
Publish
Test in Preview, then click Submit and Publish.
Hook into your router
Call gtag on each navigation, using your router's location change event. Example below uses React Router.
Disable the default page_view
If you send page views manually, set
send_page_view: falsein the config call so the first load isn't counted twice.Repeat for other pixels
Add
fbq('track', 'PageView')and equivalent calls for other platforms in the same handler.
Check whether the site is really an SPA
Most WordPress themes reload each page. Only headless or JavaScript-driven themes need this fix.
Use GTM or theme code
For a headless front end, follow the GTM or Custom code tab.
Check page transitions
Standard Webflow pages reload. If you use a third-party library for transitions (such as Barba.js), add a GTM History Change trigger or fire page_view in the library's after-transition hook.
Use built-in marketing integrations
Wix handles page views on its own in standard sites. If you use Velo or custom routing, send page_view from the router's onChange handler.
import { useEffect } from 'react';
import { useLocation } from 'react-router-dom';
export function RouteTracker() {
const location = useLocation();
useEffect(() => {
if (typeof window.gtag === 'function') {
window.gtag('event', 'page_view', {
page_path: location.pathname + location.search,
page_location: window.location.href,
page_title: document.title
});
}
if (typeof window.fbq === 'function') {
window.fbq('track', 'PageView');
}
}, [location]);
return null;
}How to confirm it's fixed
- Each link click produces one new page_view request in the Network tab.
- GA4 DebugView shows page_view with the correct page_location and page_title for each route.
- Meta Pixel Helper (or the Events Manager Test events tab) shows PageView on route changes.
- The first page load still shows exactly one page_view, not two.
- Conversion tags tied to a thank-you route fire when you reach it.
Before
- One page_view per visit
- Funnel and path reports are empty
- URL-based conversions never fire
After
- One page_view per route
- Paths and funnels reflect real journeys
- Conversions fire on the thank-you route
How to prevent it happening again
- Add route tracking to your release checklist for any router, framework or major version upgrade.
- Keep a single owner for page_view logic (GTM or code, not both).
- Test by clicking through the key journey after each deploy, not by reloading pages.
- Document which events your router should send, so new developers keep them.
- Run an automated check of your main journeys on a schedule.
Day 0
Site is rebuilt as an SPA. The tag still loads on the first page.
Day 1
Sessions look fine, but pages per session drops to about 1 (Example).
Week 2
Ad platforms report fewer conversions and bidding worsens.
Week 3
A route-change trigger is added and tested.
How FunnelGuard handles this
FunnelGuard detects this issue today. A robot visitor runs your real journey on a schedule, clicking through the steps like a customer, and checks the tracking hits sent to GA4, Google Ads, Meta and other platforms at each step. If a route change produces no page_view hit, the check flags it.
A failure is re-checked from a second region before one alert goes out, with a screenshot and a likely cause. The Free plan covers 1 site and 2 journeys with daily checks, no card needed. Paid plans start at $39/month with a 3-day free trial.
Questions people ask
Why is my single-page app not sending page_view to GA4?
An SPA loads once, so the page load event that triggers page_view runs only for the first page. Later route changes happen in JavaScript with no reload. You need to send page_view on each route change, using a GTM History Change trigger or router code.
Does GA4 track page views in a React app automatically?
Sometimes. GA4 enhanced measurement can record page views on browser history changes if the option is on. It does not work for every router or setup, so test each route in DebugView rather than assuming.
How do I track virtual page views in Google Tag Manager?
Create a History Change trigger and attach it to your GA4 page_view tag. Check in Preview mode that each route change fires the tag once. Make sure the page load trigger and history trigger don't both send the same view.
Why does GA4 show only one page per session?
The tag fired on the first load and never again, because route changes don't reload the page. This is common after moving to a single-page framework. Adding route-change page views usually restores normal pages per session.
How do I fix Meta Pixel PageView not firing on route change?
Call fbq('track', 'PageView') from your router's navigation handler or from a GTM History Change trigger. Confirm with Meta Pixel Helper or the Test events tab. Avoid also keeping a second trigger that fires on the same change.
Can I fix this without a developer?
Often yes, if you use Google Tag Manager. A History Change trigger needs no code changes. If your app has custom routing or ignores history events, a developer may need to add a call in the router.
How can I test SPA page_view tracking?
Open DevTools Network with Preserve log on, click through your site and look for a new GA4 collect request on each route. GA4 DebugView and GTM Preview give the same answer in more detail. An automated monitor can repeat this check on a schedule.
Related issues
- TRK-390SPA sends page_view twice per routeFix guide
- TRK-391Next.js/React hydration error stops tagsFix guide
- TRK-392Headless checkout loses tracking from main siteFix guide
- TRK-404Service worker caches old page with old tagsFix guide
- TRK-393Shopify checkout extensibility removed checkout.liquid scriptsFix guide
- TRK-394Shopify Customer Events (web pixel) sandbox missing eventsFix guide