Virtual Pageviews vs. Event Tracking: What’s the Difference?
Learn how virtual pageviews differ from event tracking, when to use each in GA4, and how they affect reports and single-page apps.
A virtual pageview records a new page-like screen; event tracking records a specific action, such as a click or form submission. In Google Analytics 4 (GA4), both are sent as events, but page_view has special meaning for page and screen reporting. (developers.google.com)
What’s the difference between virtual pageviews and event tracking?
A virtual pageview represents a new view of content without a full browser-page reload; an event records something a person does within a view. Use the distinction to decide whether the interaction changes where someone is in your site or app, or describes what they did there.
| Option | What it records | Example |
|---|---|---|
| Virtual pageview | A page-like destination or screen, typically with its own URL or title | Moving to a new route in a single-page app |
| Event tracking | A specific interaction or behavior | Playing a video, opening a menu, or submitting a form |
In GA4, a virtual pageview is generally sent as a page_view event, with page details such as location and referrer. An event such as video_play or form_submit can be reported as an interaction without creating another pageview. (developers.google.com)
When should I use virtual pageviews instead of events?
Use a virtual pageview when a transition takes someone to a distinct content screen that you want to analyze like a page. This suits route changes in a single-page application, or a multi-step experience where each step is a meaningful destination. Google’s SPA guidance recommends recording a pageview for each virtual screen so its location and the visitor’s journey can be measured. (developers.google.com)
Use an event when the person interacts with the current screen but does not navigate to a distinct destination. Button clicks, video plays, and form submissions are common examples. If a modal or tab functions like a separate destination in your product and you need page-level analysis for it, a virtual pageview may fit; otherwise, tracking it as an event avoids inflating pageview totals. (matomo.org)
How do virtual pageviews affect analytics reports?
Virtual pageviews increase pageview counts and add page-level data for the views you send. In GA4, page_view contributes to the Views metric, while its page-location and referrer parameters populate page dimensions; events are also available for event analysis. (support.google.com)
That extra page-level detail helps show which screens people visit, how they move between them, and where engagement occurs. But every extra virtual pageview also changes page totals and paths. If you count small interface actions as pages, the reports can make it look as though people viewed more destinations than they did. In SPAs, missing virtual pageviews can cause activity and engagement to be attributed to the initial page instead of later screens. (developers.google.com)
How should I track single-page application interactions?
Track a page_view when the app changes to a meaningful new route or screen, and track its buttons and other interactions as separate events. Configure one method for detecting route changes: GA4 can detect browser-history changes, or you can send pageviews manually when the app’s routing needs custom handling. Avoid enabling both methods for the same change, since that can send duplicate pageviews. (developers.google.com)
When a route changes, check that the page location and title reflect the new screen and that the referrer represents the previous view. Test navigation in GA4 DebugView and confirm that each transition sends exactly one page_view. If screens do not correspond to distinct destinations, or page-level reporting would add little value, use events for the interactions instead. (developers.google.com)