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
- Visitor landsReal customer opens the page
- GA4 tag firesHit is sent with ep.debug_mode=1
- Standard reportsDebug hits are left out
- Conversions and ad importsCounts look too low
Visitors reach the site normally, but the debug flag changes how GA4 treats their hits.
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
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.
Open DevTools Network
Press F12, choose the Network tab and type collect in the filter box. Reload the page.
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.
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.
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.
| Parameter | Meaning | Fine in production? |
|---|---|---|
| ep.debug_mode=1 | debug_mode sent as an event parameter | No |
| _dbg=1 | Debug flag on the hit | No |
| Neither present | Normal hit | Yes |
How to fix it
Open the GA4 tags
In your container, open the Google tag or GA4 configuration tag and every GA4 event tag.
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.
Publish
Preview mode already sets debug for you, so you do not need the field. Submit and publish a new version.
Find the setting
Search your templates and scripts for debug_mode in gtag('config', ...) and gtag('event', ...) calls.
Remove or gate it
Delete the parameter, or only set it on a test host or when a flag is present (see the snippet below).
Deploy and clear caches
Purge your CDN and page cache so old pages stop serving the flag.
Check the GA4 plugin
In your analytics plugin (for example Site Kit, MonsterInsights or similar) look for a debug or developer mode option and switch it off. Names vary by plugin.
Check theme and snippets
Search header.php, functions.php and any header and footer snippet plugin for debug_mode.
Clear caches
Purge your caching plugin and CDN.
Check theme code
In Online Store > Themes > Edit code, search theme.liquid and snippets for debug_mode.
Check apps and custom pixels
Under Settings > Customer events, review custom pixels that call gtag with debug_mode. Also check any analytics app settings.
Check custom code
Open Site settings > Custom code and any page-level custom code. Remove debug_mode from the gtag calls.
Publish the site
Changes only go live after you publish.
Check custom code and Marketing Integrations
In Settings > Custom code, and in the Google Analytics connection, look for any snippet that sets debug_mode and remove it. Then publish.
Check code injection
Go to Settings > Advanced > Code Injection and remove debug_mode from the header or footer snippets. Save.
Check tracking code
In Sites > Funnels or Websites, open the funnel or site Settings and look at the Header and Footer tracking code, and page-level custom code. Remove debug_mode and publish.
gtag('config', 'G-XXXXXXXXXX', {
'debug_mode': true
});var isDebug = location.search.indexOf('ga_debug=1') !== -1;
gtag('config', 'G-XXXXXXXXXX', isDebug ? { 'debug_mode': true } : {});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
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
- 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
- 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
Day 1
A developer adds debug_mode: true to test a new event.
Day 1
The change is published without being removed.
Day 3
Reports show fewer conversions, but DebugView looks fine.
Week 2
Someone compares GA4 with CRM leads and finds the gap.
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.
Related issues
- TRK-021Hits marked traffic_type=internal for all visitorsFix guide
- TRK-022Test traffic not marked internal (pollutes reports)Fix guide
- TRK-024Developer traffic filter not active, DebugView hits countedFix guide
- TRK-001GA4 tag missing from a funnel pageFix guide
- TRK-003Wrong GA4 measurement ID (staging or another client's property)Fix guide
- TRK-005Two GA4 measurement IDs sending to the same propertyFix guide