Sub topic 11
Checking Events in DebugView and Preview Mode
Assume you have a GA4 property, a web data stream, and basic knowledge of gtag.js or Google Tag Manager (GTM). Validation means checking both sides of an implementation:
- The tag or code fires when the user performs the action.
- GA4 receives the intended event name and parameters.
A successful tag firing does not always mean that GA4 received correct data.
Test with DebugView
DebugView is a GA4 report for inspecting events from debug-enabled devices. It is useful for checking event names, parameters, and the order of events during a test session.
For a gtag.js implementation, add debug_mode: true while testing:
gtag('event', 'newsletter_signup_click', {
placement: 'footer',
plan_type: 'free',
debug_mode: true
});For a GTM implementation, use Tag Assistant preview mode. Preview mode creates a debug session and usually marks events sent through the previewed container for DebugView.
To test an event:
- Open the GA4 property and select Admin.
- Open DebugView under the data display or data collection area.
- Open the website in the same browser session that has debugging enabled.
- Perform the action, such as submitting a form.
- Select the event in DebugView.
- Expand its parameters and compare them with your tracking plan.
DebugView can show an event within seconds, but delays can occur. Standard reports and explorations can take much longer to process, so do not use them for immediate implementation testing.
Test a GTM tag with preview mode
In Google Tag Manager:
- Select Preview and enter the website URL.
- Complete the action you want to track.
- In Tag Assistant, select the relevant data layer event.
- Check whether the GA4 Event tag appears under Tags Fired.
- Open the tag and verify the event name and parameter values.
- Check Tags Not Fired if the tag did not run.
- Confirm the GA4 Configuration or Google tag is available before the event tag runs.
The data layer is the queue of event objects that GTM reads. For example:
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'tutorial_complete',
tutorial_id: 'ga4-events-101'
});The event property activates a GTM Custom Event trigger. The tutorial_id property must be mapped in the GA4 Event tag if you want GA4 to receive it as an event parameter.
Diagnose common validation failures
| Symptom | Likely cause | Check |
|---|---|---|
| No event in Tag Assistant | Trigger did not match | Event name, trigger conditions, and container version |
| Tag fired but no DebugView event | Wrong measurement ID or consent blocked collection | Google tag configuration, stream, and consent state |
| Event appears with missing parameters | Variables were empty or not mapped | Data layer object and tag parameter fields |
| Event name is unexpected | Another tag or script also sends the event | Search for duplicate implementations |
| DebugView stays empty | Debugging is disabled or the wrong property is open | Debug session, browser, stream, and property |
The event name must match the tracking plan exactly. Check spelling, capitalization, and underscores. Also verify that a test event is sent to the intended web data stream, not to a different property or environment.
Exercise
A GTM tag appears under Tags Fired, but DebugView shows no event. Name two checks to perform.
Show answer
Verify that the tag uses the correct GA4 measurement ID and that consent settings are allowing analytics collection. Also confirm that DebugView is open for the same property and test session.