Debugging parameters in GA4 event tags
Parameters like gtm_tag_name or tag_name are present in production event tags. Useful during development but add noise to GA4 reports.
Summary
- rule_id —
ga4-debug-params-in-production - purpose — Detect GA4 event tags that ship debugging parameters to production
- effect — Debug params consume event parameter slots and pollute GA4 dimension lists
- layer — container
- reversibility — non-destructive
What fires this
The rule calls getGA4EventTags and iterates each tag's ga4.eventParameters array. A tag is flagged when any parameter name, compared case-insensitively, matches one of five values: gtm_tag_name, debug_mode, test_mode, gtm_tag, or debug. All matching parameter names are recorded on the finding. Paused tags are excluded from evaluation.
Why it matters
GA4 enforces a 25-parameter-per-event limit. Each debug parameter sent in production consumes one of those slots. Parameters like gtm_tag_name also surface as custom dimensions in GA4 reports, cluttering dimension lists if custom definitions were created for them. The debug_mode parameter, when set to true, routes hits to DebugView instead of standard reports — making production data incomplete until the parameter is removed.
Before / after
{
"eventParameters": [
{ "name": "event_category", "value": "engagement" },
{ "name": "gtm_tag_name", "value": "GA4 - Button Click" },
{ "name": "debug_mode", "value": "true" }
]
}
{
"eventParameters": [
{ "name": "event_category", "value": "engagement" }
]
}
Remediation
- Open each flagged tag and locate the parameters listed in the finding.
- Delete any parameter added only for implementation testing (e.g.
gtm_tag_name,gtm_tag). - For parameters that are useful during debugging but not in production, replace the hardcoded value with a Custom JavaScript variable that returns the value when a debug cookie or URL parameter is present, and returns
undefinedotherwise. GA4 omits parameters whose value isundefined. - Publish the updated container.
- Confirm the parameters no longer appear in GA4 DebugView or event reports.
Metadata
- Severity
- low
- Tier
- info
- Category
- ga4
- Layer
- container
- Version
- 1
- Effort
15min(about 15 minutes)- Reversibility
- non-destructive
See also
- GA4 rules — other rules in this category
- Health score — how this rule contributes to the score
- Rules catalog — browse all rules
Examples
curl https://developer.tagmanifest.com/v1/evaluate-rule \
-H "Authorization: Bearer $TM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"rule_id":"ga4-debug-params-in-production","url":"https://example.com"}'
User: Run ga4-debug-params-in-production on https://example.com
# Tool call
{
"tool": "evaluate_rule",
"arguments": {
"rule_id": "ga4-debug-params-in-production",
"url": "https://example.com"
}
}