Sub topic 10
Verifying enhanced events with DebugView and Tag Assistant
This chapter assumes you already have a GA4 web data stream with the Google tag installed, through gtag.js or Google Tag Manager (GTM). It also assumes you know the event and parameter model. Earlier chapters covered each enhanced measurement event. This one covers how to confirm that each event fires, fires once, and carries the parameters you expect.
Why verify before you report
Enhanced measurement runs inside the Google tag. You don't write the listeners, so you also can't see the code that decides when an event fires. Standard reports lag by hours, and some events are filtered or sampled before you see them. Testing in real time tells you three things:
- Whether the toggle in the data stream is actually on.
- Whether the page matches the conditions the event needs. Examples are
enablejsapi=1on a YouTube embed, or a configured query parameter for site search. - Whether your own setup duplicates an event, for example a custom
scrollevent or a second tag on the page.
You have three ways to see events as they happen:
| Tool | What it shows | Best for |
|---|---|---|
| DebugView (in GA4) | Events and parameters received by GA4, per device, in time order | Confirming what GA4 actually received |
| Tag Assistant | Tags and events as the browser processes them, before they reach GA4 | Finding why an event did not fire or fired twice |
| Browser Network tab | Raw requests to `google-analytics.com/g/collect` | Checking exact parameter values and counting requests |
How debug traffic reaches DebugView
DebugView only displays events that are flagged as debug events. Three mechanisms set the flag:
- The
debug_modeparameter on the Google tag configuration. - The Google Analytics Debugger Chrome extension.
- Tag Assistant, which turns on debug mode for the connected browser session. GTM Preview mode does the same for a GTM container.
DebugView is in GA4 under Admin, in the Data display section. Depending on your interface version it may sit under Property settings. The page has a device selector at the top left. Pick the device that matches your test browser. If you see no devices, no debug traffic has arrived in the last 30 minutes.
Option 1: turn on debug_mode in the tag
The simplest approach on a test or staging site is to set debug_mode in the config call.
<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>Every hit from this page now carries the debug flag, including the enhanced measurement events the tag generates on its own. Remove debug_mode before you publish. If you leave it on in production, every visitor becomes a debug device and DebugView gets crowded. It also makes your debug traffic harder to separate from real traffic.
Option 2: use Tag Assistant
Tag Assistant is the better choice when you cannot edit the page, or when the site uses GTM.
- Open tagassistant.google.com and choose Add domain.
- Enter the site URL. For GTM you can instead use Preview from the workspace.
- A new tab opens with your site. A connected badge appears in the Tag Assistant window.
- Interact with the site, then return to the Tag Assistant tab.
The left column lists the events Tag Assistant saw, such as Container Loaded, Window Loaded and scroll. Click an event to see which tags fired for it. Your Google tag should be listed under Tags Fired. Open a tag to see its hit details, including event name and parameters. The Output tab or Data Layer tab shows the state at that moment.
Because Tag Assistant sets the debug flag for the session, the same events also appear in DebugView. You can use both at once: Tag Assistant to see why something happened, DebugView to see what GA4 received.
Reading DebugView
DebugView has three working areas:
- Seconds stream (left). Events are grouped into one-minute buckets and listed with the newest on top. Each event name has a blue or green icon. Green means it is a key event.
- Minutes stream (center). A bar for each minute of activity over the last 30 minutes.
- Top events and user properties (right). Counts of events in the last 30 minutes.
Click any event in the seconds stream to see its parameters. You can check the parameter names and values against the expected ones here, for example percent_scrolled equal to 90 on a scroll event.
A test plan for each enhanced event
Work through the events one at a time. Clear the page state between tests, or reload, so you don't carry over earlier results.
| Event | How to trigger it | What to confirm in DebugView |
|---|---|---|
| `page_view` | Load a page, then navigate within a single-page site | One event per navigation, with the correct `page_location` and `page_referrer` |
| `scroll` | Scroll to the bottom of a long page | One event with `percent_scrolled` of `90`, fired only once per page load |
| `click` | Click a link to another domain | `outbound` is `true`, with `link_url`, `link_domain` and `link_classes` |
| `view_search_results` | Run a search on your site | `search_term` matches what you typed |
| `video_start`, `video_progress`, `video_complete` | Play an embedded YouTube video to the end | `video_title`, `video_provider`, `video_percent` and `video_duration` are present |
| `file_download` | Click a link to a PDF or other listed extension | `file_name` and `file_extension` are set |
| `form_start`, `form_submit` | Focus a form field, then submit | `form_id`, `form_name` and `form_destination` are present |
Three tests need extra care:
- Scroll. The event fires when the user reaches 90% of page depth. If the page is short, the 90% point may be on screen at load. In that case the event may fire right away or only after a small scroll, and that is correct behavior.
- Video. Check that the iframe
srccontainsenablejsapi=1. Without it, no video events appear, and DebugView will not tell you why. - Form.
form_submitdepends on the browser's submit event. A form that sends its data with JavaScript and never submits the HTML form may produceform_startonly.
Checking the raw request
DebugView shows what GA4 processed. For a precise view of the request, open the browser developer tools, choose the Network tab, and filter by collect. Each hit to /g/collect has query parameters:
enis the event name, for exampleen=scroll.ep.prefixes string parameters, for exampleep.link_domain=example.org.epn.prefixes numeric parameters, for exampleepn.percent_scrolled=90.
Counting requests with the same en value is the quickest way to find duplicates. If one click produces two en=click requests, you have two sources for the event, such as two Google tags or a custom listener that duplicates the built-in one.
Finding duplicates and missing events
Use this table to turn symptoms into causes.
| Symptom | Likely cause | Where to look |
|---|---|---|
| Every event appears twice | Two Google tags or two config calls for the same measurement ID | Tag Assistant, Tags Fired list |
| Two `page_view` events per navigation on a single-page site | Browser history setting is on, and a custom `page_view` is also sent | Data stream settings and your router code |
| No `view_search_results` event | The site's search query parameter is not in the configured list | Site search setting in the data stream |
| No video events | The embed lacks `enablejsapi=1`, or the player is not YouTube | The iframe `src` |
| No events at all in DebugView | Debug flag not set, wrong device selected, or the tag is blocked | Device selector, ad blocker, consent state |
| `scroll` fires at 25% from your code and at 90% from GA4 | Custom event reuses the built-in name | Rename the custom event, for example to `scroll_depth` |
After DebugView
DebugView confirms collection. It does not confirm that a parameter is usable in reports. Event parameters need to be registered as custom dimensions before they can appear in standard reports and Explorations. A key event marking also needs to be set separately. Those steps belong to the next chapter. Complete the verification pass first, because registering a parameter that is wrong or missing wastes time and fills a custom dimension quota that is limited per property.
Checklist
- Confirm the settings in the web data stream for each event you plan to test.
- Connect with Tag Assistant, or set
debug_modeon a non-production page. - Open DebugView and select your device.
- Trigger each event and compare its parameters against your list.
- Look for duplicates in Tag Assistant or the Network tab.
- Remove
debug_modeand disconnect Tag Assistant when you finish.
Exercise
You enable enhanced measurement site search and run a search on your site. Tag Assistant shows the page loading and the Google tag firing, but DebugView shows no view_search_results event. Name two checks you would make and the tool you would use for each.
Show answer
First, check the site search settings in the web data stream. The query parameter you search with (for example q or s) must be in the configured list, and the search results page URL must contain it. You can confirm what the URL contains from the browser address bar or the page_location value of the page_view event in DebugView. Second, check the Network tab, filtered by collect, for a request with en=view_search_results. If the request is missing, GA4 never got the event, which points to the settings or the URL. If the request is present but DebugView does not show it, check that the correct device is selected and that the request carried the debug flag.
Exercise
A single-page site shows two page_view events for every route change in DebugView. Give one likely cause and one way to confirm it.
Show answer
A likely cause is that the "Page changes based on browser history events" option is on in enhanced measurement while the site's router code also sends its own page_view event. To confirm, open the Network tab, filter by collect, and navigate to a new route. Two requests with en=page_view and the same page_location confirm the duplicate. Then turn off one source, either the history setting or the custom event.