Skip to content

GA4 SPA Pageviews: Find Duplicate Events After a Route Change

Diagnose duplicate page_view events after one SPA route change. Check automatic and manual sources and verify the sequence in DebugView.

Two paper strips with different colored tabs leading to one card
Jack Lee
2 Min Read
Share
On This Page

A quote planner changes screens once, but GA4 shows two page views for the new route. Check whether enhanced measurement and a manual tag both count that same transition.

Identify who sends the virtual page view

A single-page app can call pushState() to update the URL without reloading the document. GA4 can measure history-based page changes automatically. A GTM tag can also send a manual page_view for the same change. Google’s GTM SPA instructions disable automatic history-based page views for that setup.

Hold the route change constant

We used a fictional quote planner in Chrome. The button changed /planner/start/ to /planner/quote/ once. The document stayed the same. In one run, a simulated history source and a simulated manual source each logged a page-view record. In the other, only the manual source recorded it.

Local test setupRoute changesModeled page views for that transition
History and manual sources both active12, one record from each source
Manual source only11, from the manual source

Those records demonstrate two senders for one route change. The fixture ran neither GA4 nor GTM and sent no analytics requests.

Test one transition in DebugView

  1. On a test property or an authorized debug session, open the starting screen and record its first page_view.
  2. Navigate to one new route. Count views for that destination in the test timeline. Compare the event’s page_location and page_referrer with the two actual screens. Use GTM Preview to identify a manual sender when applicable.
  3. Choose one owner for route-change views. If GTM owns them, follow Google’s setup to disable automatic history tracking. Rerun after the change. Verify one initial view and one view for the tested navigation, in that order.

Frequently asked questions

How many page views should one virtual navigation produce?

One for a route change you intend to count as a new view. Keep the initial page load as its own check.

Does send_page_view false disable the history tracker?

Google documents history-based enhanced measurement as independent of send_page_view in the tag config. Check the web stream’s history setting separately.

What if the view count is right but the URL is wrong?

Check whether the tag reads the prior route before the app updates the location. Compare consecutive events and confirm the expected route in DebugView.

Share This Article