[null,null,["最后更新时间 (UTC):2024-08-22。"],[[["This guide helps developers track page views within single-page applications using Google Analytics 4."],["Accurate tracking involves counting views for each screen a user interacts with and ensuring correct referral data for user journey analysis."],["Implementation relies on leveraging browser history changes or custom events to trigger virtual page views for different screens within the application."],["Before starting, ensure you have a Google Analytics 4 account and a Google tag implemented on your website."],["Verification involves enabling debug mode and confirming that new `page_view` events are triggered with updated page referrer and location data upon screen transitions."]]],["Developers using Google Analytics to measure page views on single-page applications (SPAs) should count page views for each user-interacted screen and accurately track the page referrer. To implement this, they can trigger virtual page views via browser history changes using the History API's `pushState()` and `replaceState()` methods, or through custom events with the `DocumentFragment` object. After implementation, debug mode should be enabled to verify new `page_view` events for each virtual screen, ensuring referrer and location data updates correctly.\n"]]