Happy start to the week! As noted by Simo Ahava, there have been updates in Google's documentation regarding the tracking of Single Page Applications (SPA). Specifically, a section has been added addressing the configuration of the Google Tag for such pages using Google Tag Manager.

To recap, the challenge arises from the fact that content updates on websites built with React, Angular, and similar frameworks occur without page reloads. This, in turn, imposes constraints on the transmission of crucial parameters for such events, primarily the page_referrer.

Previously, analysts relied on intuition and an understanding of JavaScript for handcrafted solutions like tracking virtual page views through History Change events. Now, this is formalized in Google's documentation: to track page views on SPAs, you need to create a separate Google Tag, within which you override parameters such as page_referrer, page_location, and update.

And, of course, don't forget to use the History Change event as a trigger for this tag.

If you work with GA4 to BigQuery exports, be sure to check out my SQL cheat sheet.