Skip to main content

Forms, Leads and GA4 Reporting · Part 4: Custom JavaScript for tracking

Chapter 11.5 · 23 of 36 · 4 min

Single-page apps and history changes

On sites built with React, Vue or Next.js, the browser does not load a new document when the page changes.

Unlocks with the book

On sites built with React, Vue or Next.js, the browser does not load a new document when the page changes. That means GTM's Page View trigger runs only once, on the first load.

On a lead-gen site this bites in two places. One, multi-step forms, where each step is a new URL but not a new page. Two, the thank you page, which is really a route change.