Sub topic 2
Turning events on and off in the web data stream
This chapter assumes you already have a GA4 property with a web data stream, and that the Google tag (gtag.js or Google Tag Manager) is installed on your site. You should also know the event and parameter model. Here you will find the settings, change them, and learn what a change does and does not affect.
Where the settings live
Enhanced measurement is configured on the data stream, not in your site's code. The Google tag reads these settings from the stream and decides which listeners to attach in the browser.
To open them:
- In GA4, go to Admin.
- Under Data collection and modification, choose Data streams.
- Select the web data stream.
- Find the Enhanced measurement section and check that its toggle is on.
- Select the gear icon to see the individual events.
You need at least the Editor role on the property to change these settings. Each web stream has its own settings. If you run several streams, such as a marketing site and an app subdomain, configure each one separately.
The master switch and the per-event switches
There are two levels of control:
- The master toggle on the Enhanced measurement section turns the whole feature on or off.
- The per-event toggles inside the gear panel switch individual interaction types.
When the master toggle is off, none of the enhanced events are collected, whatever the per-event toggles show. When it is on, each event follows its own toggle. A new web stream normally starts with enhanced measurement on and most events enabled.
| Setting in the panel | Event names it controls | Main parameters sent |
|---|---|---|
| Page views (with advanced option for browser history changes) | `page_view` | `page_location`, `page_referrer`, `page_title` |
| Scrolls | `scroll` | `percent_scrolled` (always 90) |
| Outbound clicks | `click` | `link_url`, `link_domain`, `link_id`, `link_classes`, `outbound` |
| Site search | `view_search_results` | `search_term`, plus one parameter per extra query parameter |
| Video engagement | `video_start`, `video_progress`, `video_complete` | `video_title`, `video_url`, `video_provider`, `video_duration`, `video_current_time`, `video_percent` |
| File downloads | `file_download` | `file_name`, `file_extension`, `link_url`, `link_text`, `link_id`, `link_classes` |
| Form interactions | `form_start`, `form_submit` | `form_id`, `form_name`, `form_destination`, `form_length`, and `form_submit_text` on submit |
The click event name is easy to misread. Enhanced measurement sends click only for outbound links, and it adds outbound: true. It does not record every click on the page.
The last decision in the diagram matters. A toggle only permits an event. The event still needs its trigger, such as a YouTube embed with enablejsapi=1, a link to another domain, or a file with a recognized extension.
What the toggles do not do
Several behaviors surprise people the first time:
- Changes are not retroactive. Switching an event off stops new collection. Events already in GA4 stay, and events you switch on will not appear for past dates.
- Changes are not instant. The tag fetches the configuration when a page loads. Visitors with a page already open, or a cached tag, may keep the old behavior briefly.
- Disabling does not delete reports or definitions. Key events, custom dimensions, and explorations that reference an event name remain. They just stop receiving new data.
- You cannot edit built-in event names or parameters here. The panel only controls whether an event is sent. To rename an event or reshape its parameters, use event modification in the stream's settings, or send a custom event instead.
Settings with their own fields
Most toggles are simple on/off switches. Two have extra fields.
Page views and browser history changes
Under the page views row, Show advanced settings reveals the option Page changes based on browser history events. When it is on, GA4 sends a page_view each time the site changes the URL through the browser History API, which single-page applications use. The next chapter covers this in detail. For now, remember that it can duplicate page views if your site or tag setup also sends them manually.
Site search
The site search row has a field for search term query parameters. It holds a comma-separated list of the URL parameters your site uses for search terms. The default list is q,s,search,query,keyword. Replace it with the names your site really uses. For example, if search results appear at /results?term=boots, enter term. Add every name that applies. If none match, view_search_results never fires.
Checking and changing settings from your own site
The stream settings are the source of truth, but your page can override or complement them. Two cases come up often.
First, to test a change, turn on debug mode in the tag so your own hits appear in DebugView:
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX', { debug_mode: true });
</script>Remove debug_mode when you are finished. Debug traffic is useful only while you test.
Second, YouTube video events depend on the page markup, not only on the toggle. The embedded player's URL must include enablejsapi=1:
<iframe
width="560" height="315"
src="https://www.youtube.com/embed/VIDEO_ID?enablejsapi=1"
title="Product walkthrough"
allowfullscreen></iframe>If the toggle is on and you see no video events, check this parameter first. A player added later by a script can also be missed, so test with the embed present on the page.
A safe procedure for changing settings
Treat a change to enhanced measurement as a small release:
- Write down the current state. Take a screenshot of the gear panel before you edit it. The panel has no change history for individual toggles, though the property's change history report records that a setting changed.
- Change one thing at a time. If you disable scrolls and adjust search parameters together, a drop in data is harder to explain.
- Test in DebugView. Load the page with debug mode on, perform the interaction, and confirm that the event appears or no longer appears.
- Check for overlap. Search GTM and your site code for custom tags that send the same event names. For example, a manual
file_downloadorform_submitalongside the built-in one counts every interaction twice. - Watch the reports for a few days. Compare event counts before and after. A sudden jump or fall that does not match your change points to an overlap or a missed trigger.
When to turn an event off
Leave enhanced measurement on by default, since the events are free and consistent. Turn an individual event off when one of these applies:
- You have a better custom version. For scroll, enhanced measurement reports only 90%. If you want 25%, 50%, and 75%, send your own event under a different name such as
scroll_depth, so it does not collide with the built-inscroll. You can keep the built-in event too, since the names differ. - The event duplicates another tag. A third-party tool or your GTM container may already send the same event.
- The event is noisy. Pages with many form fields, or sites with many downloadable files, may flood reports with events nobody uses.
- A single-page app double-counts page views. Turn off the history option if your app already sends
page_viewitself.
Here is a custom event for a specific call to action. It replaces the broad built-in outbound click for one purpose, and sends a clearly named event with only the parameters you need:
document.querySelectorAll('a[data-track="pricing-cta"]').forEach((link) => {
link.addEventListener('click', () => {
gtag('event', 'cta_click', {
link_text: link.textContent.trim(),
link_url: link.href
});
});
});This does not require switching off outbound clicks, because the names differ (click and cta_click). Disable the built-in event only if its data is useless to you.
Common mistakes
- Turning on the master toggle and expecting every event to fire, without checking per-event toggles.
- Leaving the default search parameters when the site uses a different name.
- Adding
enablejsapi=1to the wrong URL, or not at all, and then blaming the toggle. - Reusing built-in event names (
scroll,file_download) in custom code and creating duplicates. - Changing settings on one stream and testing on another.
Exercise
Your site's search results page has the URL /find?keywordtext=boots, and viewsearch_results never appears in DebugView even though the Site search toggle is on. What is the likely cause, and what do you change?
Show answer
The default search term parameters (q, s, search, query, keyword) do not include keywordtext, so GA4 does not recognize the URL as a search. Open the gear panel in the web data stream, edit the site search field, and add keywordtext to the comma-separated list. Then reload the page with debug mode on and confirm that viewsearchresults appears with search_term set to boots.
Exercise
You want scroll reports at 25%, 50%, and 75% depth. Should you turn off the Scrolls toggle? Explain.
Show answer
No, you do not have to. The built-in scroll event only fires at 90% and is named scroll. If you send custom events named scrolldepth with a percentscrolled value of 25, 50, or 75, the names do not collide and both sets of data coexist. Turn the built-in toggle off only if you do not want the 90% event at all.