Skip to content
FunnelGuard

Fix guide by FunnelsGuard

GA4 debug_mode on in production: how to find and fix it

TRK-020Medium impactCould addBy FunnelGuardPublished Updated
On this page

What this issue is

GA4 has a debug mode meant for testing. When it is on, each hit carries a flag so that it shows up live in the DebugView report in GA4 (Admin > DebugView). You turn it on with the debug_mode parameter, with the Google Analytics Debugger browser extension, or with Preview mode in Google Tag Manager.

Why it costs you leads or sales

Where real conversions go missing
  1. Visitor landsReal customer opens the page
  2. GA4 tag firesHit is sent with ep.debug_mode=1
  3. Standard reportsDebug hits are left out
  4. Conversions and ad importsCounts look too low

Visitors reach the site normally, but the debug flag changes how GA4 treats their hits.

Conversions: real vs reportedExample numbers
Conversions: real vs reported (example)Real leads: 100 conversions; Shown in standard reports: 12 conversions0387710012Real leadsShown in standard rep…conversions

Example: a site with 100 real form leads in a week where most visitors send debug hits. Numbers are illustrative only.

How to check if your site has it

Check a live page in your browser
  1. Open the page in a clean browser

    Use a private window with no Google Analytics Debugger extension and no GTM Preview session, so you test what a real visitor gets.

  2. Open DevTools Network

    Press F12, choose the Network tab and type collect in the filter box. Reload the page.

  3. Inspect the GA4 request

    Click a request to google-analytics.com/g/collect (or your server-side domain). Look in the Payload or Query String Parameters for ep.debug_mode=1 or _dbg=1.

  4. Search your source

    View page source and search for debug_mode. In GTM, check the GA4 configuration tag and any GA4 event tags for a debug_mode field.

  5. Check GA4 itself

    Open Admin > DebugView while browsing the live site from a normal device. If your visit appears there without any debug tool, debug mode is on for everyone.

What you may see in the GA4 collect request
ParameterMeaningFine in production?
ep.debug_mode=1debug_mode sent as an event parameterNo
_dbg=1Debug flag on the hitNo
Neither presentNormal hitYes

How to fix it

Remove debug_mode by platform
  1. Open the GA4 tags

    In your container, open the Google tag or GA4 configuration tag and every GA4 event tag.

  2. Remove debug_mode

    Under Configuration settings or Event parameters, delete any row named debug_mode. If it comes from a variable, check that the variable does not return true on the live site.

  3. Publish

    Preview mode already sets debug for you, so you do not need the field. Submit and publish a new version.

Before: debug on for everyonejavascript
gtag('config', 'G-XXXXXXXXXX', {
  'debug_mode': true
});
After: debug only when you ask for itjavascript
var isDebug = location.search.indexOf('ga_debug=1') !== -1;

gtag('config', 'G-XXXXXXXXXX', isDebug ? { 'debug_mode': true } : {});
Hit behaviour

debug_mode left on

  • Every visitor sends ep.debug_mode=1
  • Hits show only in DebugView
  • Standard reports and conversions look too low

debug_mode removed

  • Normal visitors send ordinary hits
  • Hits count in standard reports
  • Debug still available to you through Preview or the extension
Toggle debug_mode in productionInteractive
debug_mode left on for all visitors

debug_mode on

Leads or data lost

Real visitor hits are marked as debug, appear only in DebugView and are missing from standard reports and conversion counts.

Switch the cause on to see what your reports look like with debug flagged hits.

How to confirm it's fixed

Confirmation checklist
  • Published the change and purged page and CDN caches
  • In a private window with no debug extension, the collect request has no ep.debug_mode or _dbg parameter
  • Your own visit no longer appears in DebugView unless you use Preview or the extension
  • Realtime report shows your test visit and event
  • After a day, standard reports show events and conversions again for new traffic

How to prevent it happening again

Prevention habits
  • Debug with GTM Preview or the Google Analytics Debugger extension, not by editing live code
  • If you must set debug_mode in code, gate it behind a URL flag or a staging hostname
  • Add debug_mode to your launch checklist as something to search for before publishing
  • Review tag changes in GTM version notes before each publish
  • Compare GA4 key events with form or order counts in your CRM or store each week
How it usually happens
  1. Day 1

    A developer adds debug_mode: true to test a new event.

  2. Day 1

    The change is published without being removed.

  3. Day 3

    Reports show fewer conversions, but DebugView looks fine.

  4. Week 2

    Someone compares GA4 with CRM leads and finds the gap.

  5. Week 2

    debug_mode is removed and reports recover for new traffic.

How FunnelGuard handles this

Questions people ask

Why are my GA4 events showing in DebugView but not in reports?

DebugView shows hits sent with debug mode on, and Google leaves those out of standard reports. If real visitors send ep.debug_mode=1, you will see events in DebugView and missing data elsewhere. Remove debug_mode from your tag or code to fix it.

How do I turn off GA4 debug mode?

Delete the debug_mode parameter from your gtag config or event calls, or from the Google tag and event tags in Google Tag Manager, then publish. Close any GTM Preview session and disable the Google Analytics Debugger extension in your own browser. Clear caches afterwards.

How can I tell if debug_mode is on for all my visitors?

Open a private window with no debug extension, open DevTools, go to Network, filter for collect and reload. If the google-analytics.com/g/collect request contains ep.debug_mode=1 or _dbg=1, debug mode is on for everyone.

Does GA4 debug mode affect my conversions?

Yes. Debug hits are excluded from standard reports, so key events and revenue sent that way will not count there. If real visitors send them, conversions look lower than they are, and any ad platform importing those key events gets less data.

Is it safe to leave debug_mode on in GA4?

Not on a live site for all visitors. It is meant for testing. Use GTM Preview or the Google Analytics Debugger extension to debug your own sessions, and keep debug_mode out of production code.

Will the missing GA4 data come back after I fix debug_mode?

You should not expect it to. Hits already sent as debug were left out of standard reports and are not normally added later. New traffic counts correctly once the flag is gone, so note the fix date in your reporting.

Is debug_mode the same as internal traffic in GA4?

No. Debug mode sends hits to DebugView and keeps them out of standard reports. Internal traffic is a traffic_type=internal flag used with data filters to exclude your own team. They are set and fixed in different places.

Does FunnelGuard check for GA4 debug_mode?

Not yet. It is a possible future check. FunnelGuard does check that GA4 and other tracking hits fire on your journeys, but you need to inspect the collect request for ep.debug_mode yourself.

Does FunnelGuard catch this?

Could add

Not checked yet: could be added to FunnelGuard.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.