Skip to content
FunnelGuard

Fix guide by FunnelsGuard

SPA route change sends no page_view: how to find and fix it

TRK-389High impactDetectedBy FunnelGuardPublished Updated
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.

Where the tracking stops
  1. Landing pageFull load, page_view sent
  2. Route change to /pricingNo reload, no page_view
  3. Route change to /checkoutNot recorded
  4. 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.

Page views recorded per visitExample numbers
Page views recorded per visit (example)Actual routes viewed: 5 page views; Recorded (broken): 1 page views; Recorded (fixed): 5 page views024515Actual routes viewedRecorded (broken)Recorded (fixed)page views

Example: a visitor views 5 routes. With the issue, analytics records 1. After the fix it records 5.

A route change with no tag

The URL changes, but no tracking request leaves the browser.

How to check if your site has it

Test route changes in your browser
  1. Open DevTools Network

    Press F12, open the Network tab and filter by collect (GA4) or tr (Meta Pixel). Turn on Preserve log.

  2. Load the first page

    You should see a GA4 request with en=page_view.

  3. Click through the site

    Use the site's own links, not the browser reload. Watch for a new request on each route.

  4. 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).

Send a page_view on every route change
  1. Add a History Change trigger

    Go to Triggers > New > History Change. Save it as 'History Change - All'.

  2. 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.

  3. 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.

  4. Publish

    Test in Preview, then click Submit and Publish.

React Router: send page_view on route changejavascript
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

Fix verification
  • 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.
Route tracking

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

Prevention
  • 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.
How the problem often unfolds
  1. Day 0

    Site is rebuilt as an SPA. The tag still loads on the first page.

  2. Day 1

    Sessions look fine, but pages per session drops to about 1 (Example).

  3. Week 2

    Ad platforms report fewer conversions and bidding worsens.

  4. 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.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

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.