How to Use GA4 Debug Mode: Complete Troubleshooting Guide
Learn how to enable GA4 debug mode, use DebugView in real-time, and troubleshoot tracking issues. Step-by-step guide with GTM and gtag.js methods.
GA4 DebugView shows events firing in real-time from your device. It is the fastest way to verify that your tracking is working before pushing changes live.
How to Enable Debug Mode
There are three ways to enable debug mode. Each sends events with a debug_mode flag so GA4 shows them in DebugView.
Method 1: Google Tag Assistant (Easiest)
- Install the [Tag Assistant Companion](https://chrome.google.com/webstore/detail/tag-assistant-companion/) Chrome extension
- Open your website
- Click the Tag Assistant icon and enable debug mode
- Open GA4 > Admin > DebugView
Events from your browser will appear in real-time.
Method 2: GTM Preview Mode
If you use Google Tag Manager:
- Open your GTM container
- Click "Preview" in the top right
- Enter your website URL
- Browse your site in the preview window
GTM preview automatically enables GA4 debug mode. Events will show in DebugView.
Method 3: gtag.js Config Parameter
If you use gtag.js directly, add the debug parameter:
gtag('config', 'G-XXXXXXXXXX', { debug_mode: true });javascript
Important: Remove this before deploying to production. You do not want every visitor showing up in DebugView.
For testing on a specific device, you can use a URL parameter approach:
// Enable debug mode via URL parameter const urlParams = new URLSearchParams(window.location.search); if (urlParams.get('debug') === 'true') { gtag('config', 'G-XXXXXXXXXX', { debug_mode: true }); }javascript
Then visit yoursite.com?debug=true to enable it.
How to Read DebugView
DebugView shows a timeline of events from your device. Here is what to look for:
The timeline (center column): Each bubble is an event. Click any event to see its parameters. Events appear in chronological order, newest at top.
Event parameters (right panel): When you click an event, you see all parameters sent with it. Check that:
- `page_location` is correct
- `page_title` is populated
- Custom parameters have the right values
- Ecommerce parameters (`currency`, `value`, `items`) are present
User properties (top right): Shows user-scoped properties like `user_id` if you set them.
Color coding:
- Green bubbles = conversion/key events
- Blue bubbles = standard events
- Orange bubbles = events with errors
Common Issues and Fixes
Events Not Appearing in DebugView
Cause 1: Wrong property. Make sure you are looking at DebugView in the correct GA4 property. Check the Measurement ID matches.
Cause 2: Ad blocker. Disable ad blockers and privacy extensions. They block google-analytics.com and googletagmanager.com requests.
Cause 3: Consent mode blocking. If consent mode denies analytics_storage, events may not fire in debug mode. Temporarily grant consent to test.
Cause 4: Caching. Clear your browser cache and hard refresh. Old cached pages might not have the updated tracking code.
Events Firing But Parameters Missing
Check your dataLayer push. The most common mistake is pushing parameters outside the event:
// WRONG — parameters are not attached to the event dataLayer.push({ currency: 'USD', value: 49.99 });javascript
// CORRECT — parameters inside the event push
dataLayer.push({
event: 'purchase',
currency: 'USD',
value: 49.99,
transaction_id: 'T-12345',
items: [{ item_id: 'SKU001', item_name: 'Widget', price: 49.99 }]
});
`
Duplicate Events
If you see the same event firing twice, you likely have both gtag.js and GTM sending to the same GA4 property. Remove one. Check your page source for both gtag('config', 'G-XXX') and a GTM container loading the same Measurement ID.
DebugView vs Realtime Report
DebugView and Realtime are different:
| Feature | DebugView | Realtime |
|---|---|---|
| Shows events from | Your debug device only | All users |
| Parameter detail | Full parameter inspection | Limited |
| Delay | Instant | 1-2 seconds |
| Use case | Testing/QA | Monitoring live traffic |
Use DebugView for testing. Use Realtime to verify after deploying to production.
Pro Tip: Debug Mode in Production
For production debugging without modifying code, use the Chrome DevTools approach:
- Open Chrome DevTools (F12)
- Go to Console
- Run: `gtag('config', 'G-XXXXXXXXXX', { debug_mode: true })`
- Navigate your site. Events will appear in DebugView.
This only affects your browser session.
Not sure if your tracking is working? Audit your GA4 setup →
Check your GA4 implementation
Run a free AI-powered audit to see how your tracking stacks up.
Start Free Audit