Tracking Page Views in a React SPA with Google Analytics 4

Adding Google Analytics (GA4) to a standard HTML website is straightforward: paste the tracking snippet into your and you're done. Every time a user clicks a link, the browser fetches a new HTM