Sub topic 1
What Enhanced Measurement Is and Which Events It Covers
Prerequisites
You need a GA4 property with a web data stream, and the Google tag (gtag.js or Google Tag Manager) installed on your site. You should understand the GA4 event and parameter model and be comfortable in the GA4 Admin interface. Basic HTML and JavaScript help when you read the code in later chapters.
What Enhanced Measurement Is
Enhanced measurement is a set of switches in a web data stream. When a switch is on, GA4 sends events for common visitor interactions without any custom code. These events cover page views, scrolling, outbound clicks, site search, video engagement, file downloads, and form interactions.
Each event carries parameters, which are extra fields that describe the interaction. The scroll event, for example, includes a percent_scrolled value.
Turning Events On and Off
Open Admin, select your web data stream, and open Enhanced measurement. Each event type has its own toggle. Some toggles open extra options, such as the query parameters used for site search.
Changes apply to data collected after you save them. They do not alter past reports.
Page Views and Browser History Changes
A page view fires on each full page load. Single-page apps change content without reloading the page. To cover these sites, GA4 listens for browser history events, such as pushState and popstate. When the URL changes through these events, GA4 sends a page_view event.
If your app updates content without changing the URL, GA4 cannot detect the change, and the page view is missed.
The Scroll Event and the 90% Threshold
The scroll event fires once per page when a visitor reaches 90% of the page depth. GA4 does not send events at 25%, 50%, or 75%. The event name is scroll, and its percent_scrolled parameter is set to 90.
A 90% threshold shows whether visitors reach the bottom of a page. It does not show how far readers get in the middle of a page.
Exercise
Exercise
A single-page app changes its URL with pushState when the visitor moves between sections, but it never reloads the page. Will enhanced measurement send page_view events for these changes, and why?
Show answer
Yes, if the browser history events fire. GA4 listens for pushState and popstate browser history events, so it sends a pageview when the URL changes. If the app changes content without updating the URL, no pageview is sent.