Sub topic 11
A step-by-step verification workflow
This chapter assumes you already know what GA4 events, parameters and user properties are. It also assumes you can open Realtime and DebugView, and that you have Editor access to a property with a web or app data stream. The aim is a routine you can repeat every time you ship or change tracking, so that a result such as "it works" is based on evidence.
Why a fixed workflow helps
Realtime and DebugView answer different questions. Realtime tells you whether data from real traffic reaches the property at all. DebugView tells you whether one device sent the right events with the right parameters. If you jump between them without a plan, you can misread normal delay as a bug, or approve an event that carries wrong values.
The workflow below goes from the cheapest check to the most detailed one. Each step has a pass condition. Stop at the first step that fails and fix it before continuing.
Step 1: Write a test plan
Before you touch a browser, list what you expect to see. A table is enough.
| Action on the site | Expected event | Expected parameters | Key event? |
|---|---|---|---|
| Open the home page | page_view | page_location, page_title | No |
| Submit the newsletter form | sign_up | method = email | Yes |
| Click the pricing button | select_promotion | promotion_name | No |
The plan gives you something to compare against. Without it, you tend to accept whatever appears. Include the user properties you expect, such as a plan type, and any event that should not fire, such as a duplicate page_view on a single-page app route change.
Pass condition: every action has an expected event name and parameter list.
Step 2: Enable debug mode
Debug mode flags traffic from your device so that DebugView shows it. Pick the method for your platform.
On a website using gtag.js, set the flag on the config command. Every event from that page load is then marked as debug traffic.
gtag('config', 'G-XXXXXXXXXX', {
'debug_mode': true
});To test one interaction only, add the parameter to a single event.
gtag('event', 'sign_up', {
'method': 'email',
'debug_mode': true
});With Google Tag Manager, open Preview mode, or use Tag Assistant to connect to the site. Both put the browser into debug mode without code changes. The Google Analytics Debugger browser extension also works.
On Android, set the debug property for your package. Use the same command with .none. to switch it off.
# Android: turn on debug mode for an app
adb shell setprop debug.firebase.analytics.app com.example.myapp
# Android: turn it off again
adb shell setprop debug.firebase.analytics.app .none.On iOS, add -FIRAnalyticsDebugEnabled to the Arguments Passed On Launch in your Xcode scheme.
Pass condition: your device appears in the DebugView device selector (Admin > Data display > DebugView) within a few seconds of a page load or app launch.
Step 3: Trigger each action once
Work through the test plan one row at a time. Do each action once, and wait a moment before the next one. Single, spaced actions make the DebugView timeline easy to read. If you click ten times, you cannot tell which click produced which event.
Keep notes on the order you performed the actions. DebugView groups events by minute and second, so the order lets you match each event to its action.
Use a clean browser state when you test consent behavior. Consent banners, ad blockers and cached tag configuration can all change what is sent. Run at least one pass in a normal profile with extensions on, because that is closer to what your visitors have.
Pass condition: you performed each action in the plan and recorded the order.
Step 4: Inspect DebugView
Select your device in the device selector. The center column shows a stream of events, and the minute and second timelines show when each one arrived. Click an event to see its parameters. Click the user properties area to see the values attached to the device.
Check these things for each row of your plan:
- The event name matches exactly. GA4 names are case sensitive, so
Sign_Upandsign_upare different events. - Each expected parameter is present with the right value and type.
- Key events are marked with the key event flag in the stream.
- The count is right. One action should produce one event, unless the plan says otherwise.
- User properties carry the expected values.
DebugView shows events from the Measurement Protocol too, when the request includes the debug_mode parameter. For a server-side check before you send real data, validate the payload with the debug endpoint. It returns validationMessages and does not record the event.
curl -X POST "https://www.google-analytics.com/debug/mp/collect?measurement_id=G-XXXXXXXXXX&api_secret=YOUR_API_SECRET" \
-H "Content-Type: application/json" \
-d '{
"client_id": "test.1234567890",
"events": [{
"name": "sign_up",
"params": { "method": "email" }
}]
}'An empty validationMessages array means the payload is valid. The endpoint checks format only. It does not prove the event reached your property, so a valid payload still needs a real request with debug_mode set to confirm it in DebugView.
If an event is missing or its values are wrong, return to step 2 and check that debug mode is really on, then look at the tag or code. The troubleshooting chapter lists the common causes.
Pass condition: every row of the test plan matches what DebugView shows, with no unexpected extra events.
Step 5: Confirm in Realtime
DebugView proves the implementation is correct for your device. Realtime proves that the same data lands in the property as ordinary reporting traffic. Open Reports > Realtime and look at the cards.
- The users card should count you. Open the site in a second tab on a second device, such as your phone on mobile data, to see the count rise.
- The event count by event name card should list your event names.
- The key events card should list the events you marked as key events.
- The user properties card should show the values you set.
You can also read the same data through the Realtime Reporting API. This helps when you want a scripted check, for example in a deployment pipeline.
curl -X POST "https://analyticsdata.googleapis.com/v1beta/properties/PROPERTY_ID:runRealtimeReport" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"dimensions": [{ "name": "eventName" }],
"metrics": [{ "name": "eventCount" }]
}'Remember the limits of Realtime. It covers roughly the last 30 minutes, and it shows only recent activity. Realtime numbers will not match standard reports, which are processed later and can be changed by attribution, filters and thresholds. Do not try to reconcile the two. Use Realtime only to confirm that data is arriving.
Pass condition: the event names and key events from the plan appear in Realtime within a minute or so of a non-debug visit.
Step 6: Clean up and document
When the checks pass, remove what you added for testing.
- Turn off debug mode: remove
debug_mode, end the GTM preview session, or run theadbcommand with.none.. - Confirm that the Developer traffic filter state is what you intend. In Admin > Data collection and modification > Data filters, the Developer traffic filter should be Active in production once you have finished testing, and Testing while you still need to see what it would exclude.
- Delete or ignore any test conversions and fake users that you created. Standard reports keep data that was collected without the debug flag, and GA4 does not let you delete individual events.
- Save the test plan with the result and date. The next release can reuse it as a regression checklist.
Pass condition: debug mode is off in the code that will be deployed, the filter state is set on purpose, and the test plan is saved.
Common ways the workflow goes wrong
- Testing with an ad blocker or strict browser. Requests to Google domains are blocked, so nothing appears anywhere. Test with extensions disabled first, then with them on.
- Judging the result from Realtime only. An event can arrive with a missing parameter and still show in the Realtime event card. Always inspect the parameters in DebugView.
- Expecting parameters in reports straight away. A custom parameter shows in Realtime or DebugView, but it does not appear in standard reports until you register it as a custom dimension or metric, and then only for new data.
- Using Realtime to count a test. Realtime is a rolling window, so its numbers change as time passes. Take a note of what you saw, not a total.
- Testing in production without a filter. If the Developer traffic filter is Inactive, test sessions from non-debug devices enter your reports.
Exercise
You added a sign_up event and tested it in DebugView, and the method parameter showed as "email". The next day, a colleague says the parameter is not available in a standard report. Which step of the workflow did not cover this, and what should you do?
Show answer
DebugView and Realtime only confirm that data arrives with its parameters. They do not make a custom parameter available in standard reports. Register method as an event-scoped custom dimension in Admin > Data display > Custom definitions. The dimension then applies to data collected from that point on, so repeat a test visit afterwards to confirm the dimension fills in.
Exercise
You finish testing with debug mode on a development device, and Realtime shows no users from your test visit, although DebugView listed all of the events. The Developer traffic filter is set to Active. Explain why, and name one way to still see a Realtime result.
Show answer
With the filter Active, traffic flagged as debug is excluded from reports, including Realtime. DebugView still shows it because DebugView reads the debug stream. To see a Realtime result, test with a second device that is not in debug mode, or set the filter to Testing while you work so that the traffic is kept and labeled.