Sub topic 12
Validating Events with DebugView and Realtime Reports
Assume you know GA4 properties and data streams, can read JavaScript objects, and have implemented at least one e-commerce event such as purchase. Validation means checking both that an event arrived and that its parameters contain the values your reports need.
Use DebugView for event-level checks
DebugView is the best place to inspect test traffic immediately. Open Admin > Data display > DebugView, select the correct data stream, and perform the shopping action in a test browser.
Your device must send debug traffic. With gtag.js, include debug_mode in the event or configure it for your test setup:
gtag('event', 'purchase', {
debug_mode: true,
transaction_id: 'TEST-1001',
currency: 'USD',
value: 49.98,
items: [
{
item_id: 'SKU_1001',
item_name: 'Trail Running Shoe',
price: 24.99,
quantity: 2
}
]
});In DebugView, select the event and inspect its parameters. For a purchase, verify transaction_id, currency, value, and items. Expand the item to check its ID, price, and quantity. Confirm that values have the expected types: prices, quantities, and totals should be numbers, not formatted strings such as $49.98.
With Google Tag Manager, use Preview mode to confirm that the data layer push occurs, the GA4 event tag fires once, and the tag maps the expected values. Then inspect the resulting event in DebugView.
Use Realtime for a wider sanity check
The Realtime report shows activity from users during the recent period, not only your debug device. Open Reports > Realtime, find the event count card, and select an event name. Use it to answer questions such as:
- Did production traffic send
add_to_cartandpurchaseevents? - Are events arriving from the expected data stream?
- Did a release cause event volume to drop?
- Are test transactions appearing more than once?
Realtime is useful for confirming that collection works beyond your test browser. It is not a replacement for DebugView. Realtime can aggregate events, while DebugView exposes the parameters of an individual test event. Standard reports and explorations can take longer to process.
Follow a repeatable validation path
flowchart TD
A[Trigger a test shopping action] --> B{Event visible in DebugView?}
B -- No --> C[Check consent, tag firing, and request]
B -- Yes --> D[Inspect event and item parameters]
D --> E{Values and types correct?}
E -- No --> F[Fix mapping or data layer]
E -- Yes --> G[Check event in Realtime]
G --> H[Compare production volume and revenue]| Check | Expected result |
|---|---|
| Event name | Recommended name such as `purchase` |
| Transaction ID | Present and unique for the order |
| Currency and value | Valid currency code and numeric total |
| Items | Correct IDs, prices, and quantities |
Common validation errors
A missing event usually indicates a tag, consent, trigger, or request problem. A visible event with wrong revenue usually indicates incorrect currency, string values, stale data layer objects, or a total that does not match the items. Duplicate purchases often result from firing the tag on both the confirmation page and a button click. Test with a unique transaction ID and verify that the purchase fires once.
Exercise
A purchase appears in DebugView, but its items array is empty. What should you inspect first?
Show answer
Inspect the data layer or event object before the GA4 tag fires, then verify that the tag maps that object to the items parameter.