Event names exceed 40-character limit
Event names longer than 40 characters are silently truncated by GA4, potentially merging distinct events.
Summary
- rule_id —
ga4-event-name-length - purpose — Detect GA4 event names longer than 40 characters
- effect — GA4 silently truncates the name, potentially merging distinct events into a single record
- layer — container
- reversibility — non-destructive
What fires this
The rule calls getGA4EventTags(data) to collect all active GA4 event tags, then filters to those where t.ga4.eventName exists and its .length exceeds 40. Each tag over the threshold appears in the issue payload with its tag ID, tag name, event name, and character count. Paused tags are excluded by getGA4EventTags.
Why it matters
GA4 enforces a 40-character maximum on event names with no warning. Any name exceeding that limit is silently truncated at the collection boundary. Two distinct events — download_whitepaper_product_brochure_2024 and download_whitepaper_product_brochure_2025 — truncate to the same string and become indistinguishable in reports. GTM (Google Tag Manager) Preview mode shows the full name; GA4 DebugView shows the truncated version. Conversion events with colliding names lose attribution accuracy.
Before / after
Event name (44 chars):
download_whitepaper_product_brochure_2024
Event name (44 chars):
download_whitepaper_product_brochure_2025
Both truncate to the same 40-char string.
GA4 merges them into one event.
Event name (28 chars):
download_brochure_2024
Event name (28 chars):
download_brochure_2025
Each name is distinct and under the limit.
GA4 records them separately.
Remediation
- Open each flagged GA4 event tag in GTM — the issue payload lists tag ID, event name, and character count.
- Shorten the event name to 40 characters or fewer, using abbreviations or moving detail into a parameter.
- Confirm the shortened name is unique across all other GA4 event tags in the container.
- Update any Custom Event triggers and GA4 conversion definitions that reference the old name.
- Publish the container and verify the event appears correctly in GA4 DebugView.
Metadata
- Severity
- high
- Tier
- optimization
- 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-event-name-length","url":"https://example.com"}'
User: Run ga4-event-name-length on https://example.com
# Tool call
{
"tool": "evaluate_rule",
"arguments": {
"rule_id": "ga4-event-name-length",
"url": "https://example.com"
}
}