On this page
What this issue is
A single-page app (SPA) loads once and then swaps content with JavaScript. The address bar changes, but the page never fully reloads. Many funnels, quote forms, booking widgets and some checkouts work this way. They are often built with React, Vue, Angular or a page builder with in-page steps.
- Landing pageFull page load, page_view sent
- Step 2 /detailsURL changes, no page_view
- Step 3 /paymentNot recorded
- Thank-you /doneNot recorded
Only the first load sends a page_view. Later steps change the URL but send nothing.
Why it costs you leads or sales
Example: with history change tracking off, only the first step is counted. Numbers are illustrative.
How to check if your site has it
Check the setting
In GA4 go to Admin > Data streams > your web stream > Enhanced measurement > gear icon > Page views > Advanced settings. See whether Page changes based on browser history events is on.
Open DebugView
Use Tag Assistant or the GA Debugger extension, then open Admin > DebugView. Walk through your funnel.
Count page_view events
You should see one page_view per step. If you only see one at the start, history changes are not tracked.
Check Reports
In Reports > Engagement > Pages and screens, look for your later step paths. If they are missing or show very low views, the problem is likely present.
How to fix it
Turn off the GA4 toggle if you use GTM triggers
In GA4 Enhanced measurement, switch off history change events so you do not double count.
Add a History Change trigger
In GTM, Triggers > New > History Change. Fire on All History Changes.
Create a GA4 Event tag
New tag > Google Analytics: GA4 Event, your measurement ID, event name page_view. Attach the History Change trigger.
Preview and publish
Use Preview mode, click through the funnel, and confirm the tag fires once per step before publishing.
Send page_view on each route change
Call gtag with event page_view in your router's after-navigation hook. Turn off the Enhanced measurement history option to avoid duplicates.
Include page_location and page_title
Pass the new URL and title so reports show the right page.
Turn on the GA4 setting
If your theme or plugin builds a JavaScript app with in-page steps, enable history change in Enhanced measurement (Admin > Data streams). Standard WordPress pages reload, so they do not need it.
Check your analytics plugin
If a plugin sends its own page_view for virtual steps, leave the toggle off.
Check for in-page steps
Webflow pages reload normally. If you use a third-party SPA widget or multi-step form that changes the URL, enable the history change option in Enhanced measurement.
// Call this after each route change
function trackPageView() {
gtag('event', 'page_view', {
page_location: window.location.href,
page_path: window.location.pathname,
page_title: document.title
});
}
// Example: wrap history.pushState if your router has no hook
(function (history) {
var push = history.pushState;
history.pushState = function () {
var result = push.apply(this, arguments);
setTimeout(trackPageView, 0);
return result;
};
})(window.history);History change off
- 1 page_view recorded
- Funnel shows 100% drop after step 1
- Later page paths missing in reports
History change tracked
- 4 page_views recorded, one per step
- Funnel exploration shows real drop-off
- Page-based key events can match
How to confirm it's fixed
- DebugView shows one page_view for every step you click through
- Each page_view has the correct page_location and page_title
- No step shows two page_views in a row
- Back and forward buttons also send a page_view
- After 24 hours, Pages and screens lists your step paths
- Funnel exploration shows more than one step
How to prevent it happening again
Day 0
Funnel rebuilt as a single-page app
Day 1
Only the first page_view is recorded
Week 2
Reports show a huge drop after step 1 and the wrong campaign is paused
Week 3
History change tracking enabled and tested
How FunnelGuard handles this
Questions people ask
Why is GA4 only tracking the first page of my single-page app?
A single-page app does not reload between steps, and GA4 sends page_view on load. Unless history change tracking is on, or you send page_view yourself, later steps are never recorded.
How do I turn on page_view for history changes in GA4?
Go to Admin > Data streams > your web stream > Enhanced measurement > gear icon > Page views > Advanced settings, and switch on Page changes based on browser history events. Then test in DebugView.
Why do I see two page_views per step after fixing it?
You are probably using both the Enhanced measurement toggle and a manual or GTM page_view. Keep one method and turn the other off.
Do I need a GTM History Change trigger if the GA4 toggle is on?
No. The toggle already sends page_view on history changes. Use the GTM trigger only if you prefer to control events in GTM, and then switch the toggle off.
How do I test that GA4 tracks SPA route changes?
Open DebugView with Tag Assistant or the GA Debugger extension and click through each step. Every step should show one page_view with the right page_location.
Does this affect normal WordPress or Shopify pages?
Usually not, because those pages reload fully and send a normal page_view. It matters for in-page steps, app-style checkouts, booking widgets and framework-built sites.
Can FunnelGuard tell me if my SPA funnel is missing page_views?
Yes. FunnelGuard runs your journey on a schedule and checks for a page_view at each step. It alerts you with a screenshot and a likely cause if a step sends none.
Related issues
- TRK-006GA4 installed twice (gtag.js and GTM) causing double page_viewsFix guide
- TRK-001GA4 tag missing from a funnel pageFix guide
- TRK-007GA4 config fires after the conversion event (race on fast redirects)Fix guide
- TRK-012GA4 missing on thank-you or order confirmation pageFix guide
- TRK-008gtag.js loaded but config command never calledFix guide
- TRK-003Wrong GA4 measurement ID (staging or another client's property)Fix guide