Home/Blog/GA4 Debugging
GA4 Debugging7 min read

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, debug mode, DebugView, troubleshooting, GTM

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)

  1. Install the [Tag Assistant Companion](https://chrome.google.com/webstore/detail/tag-assistant-companion/) Chrome extension
  2. Open your website
  3. Click the Tag Assistant icon and enable debug mode
  4. Open GA4 > Admin > DebugView

Events from your browser will appear in real-time.

Method 2: GTM Preview Mode

If you use Google Tag Manager:

  1. Open your GTM container
  2. Click "Preview" in the top right
  3. Enter your website URL
  4. 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:

FeatureDebugViewRealtime
Shows events fromYour debug device onlyAll users
Parameter detailFull parameter inspectionLimited
DelayInstant1-2 seconds
Use caseTesting/QAMonitoring 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:

  1. Open Chrome DevTools (F12)
  2. Go to Console
  3. Run: `gtag('config', 'G-XXXXXXXXXX', { debug_mode: true })`
  4. 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