Skip to main content
TagManifest /Docs Dashboard

debug_mode hardcoded to true

debug_mode is set to literal "true" instead of a GTM variable, so it stays on in production.

On this page 6

Summary

  • rule_id — ga4-debug-mode-hardcoded
  • purpose — Detect GA4 tags with debug_mode hardcoded to the literal string "true"
  • effect — Events are excluded from standard GA4 reports and visible only in DebugView
  • layer — container
  • reversibility — non-destructive

What fires this

The rule calls getGA4Tags() to collect all active GA4 Configuration and Event tags in the container. For each tag it merges ga4.eventParameters and ga4.configSettings into a single parameter list, then checks whether any entry has name === 'debug_mode' and value === 'true'. The check is a strict string match against the literal value "true" — a GTM variable reference does not trigger it. All matching tags are returned as a single issue, listed by tag ID and name. Paused tags are excluded by getGA4Tags().

Why it matters

When debug_mode is true, GA4 routes events through DebugView instead of standard reporting. Those events do not appear in Explorations, standard reports, or conversions. Any tag left in this state in production silently drops data from your analytics. The parameter persists across every page where the tag fires. The fix is environmental: a GTM Lookup Table variable can return "true" only in preview mode and omit the parameter entirely in production.

Before / after

{
  "parameter": [
    { "type": "boolean", "key": "debug_mode", "value": "true" }
  ]
}
{
  "parameter": [
    { "type": "template", "key": "debug_mode", "value": "{{Debug Mode Variable}}" }
  ]
}

Remediation

  1. Open GTM and navigate to each flagged GA4 tag.
  2. Locate the debug_mode parameter in event parameters or configuration settings.
  3. If debug mode was left over from testing, delete the parameter entirely.
  4. If debug mode is needed for non-production environments, create a Lookup Table variable: map GTM's built-in {{Debug Mode}} value true to the string "true", and set the default value to blank (omits the parameter in production).
  5. Replace the hardcoded "true" with the new variable.
  6. Preview the container to confirm DebugView activates in preview and standard reports receive events in production.
  7. Publish the container.

Metadata

Severity
high
Tier
optimization
Category
ga4
Layer
container
Version
1
Effort
15min (about 15 minutes)
Reversibility
non-destructive

See also

Examples

Evaluate
curl https://developer.tagmanifest.com/v1/evaluate-rule \
  -H "Authorization: Bearer $TM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"rule_id":"ga4-debug-mode-hardcoded","url":"https://example.com"}'