Sub topic 7
Naming rules, reserved names, and limits
This chapter covers the rules GA4 applies to event names and parameter names, the names you cannot use, and the quotas that cap how much data a property accepts. It assumes you can read JavaScript objects and gtag() calls, and that you know what a custom event and an event parameter are from earlier chapters. The limits below are for standard properties. GA4 360 properties have higher quotas, which the table shows.
Why the rules matter
GA4 does not reject most badly named events with an error. It either drops the event or accepts it in a form you did not intend. A misspelled recommended event name becomes a custom event that none of the built-in reports recognize. A parameter that goes over a quota is silently dropped. Naming mistakes therefore show up weeks later as missing data. Most are permanent, because history cannot be renamed.
Rules for event and parameter names
Event names and parameter names follow the same format rules:
- Use only letters, numbers, and underscores. Spaces, hyphens, and dots are not allowed.
- Start with a letter, not a number or underscore.
- Use at most 40 characters.
- Remember that names are case-sensitive.
Sign_Up,sign_up, andSIGN_UPare three different events, and each one counts toward your event-name quota.
Google's convention is snake_case: lowercase words joined by underscores. Recommended events and automatically collected events already use it, so your custom names stay consistent with them if you follow it too.
// Valid names
gtag('event', 'newsletter_signup_click', { placement: 'footer' });
gtag('event', 'video_chapter_view', { chapter_number: 3 });
// Invalid or risky names
gtag('event', 'Newsletter Signup Click', { Placement: 'footer' }); // spaces, mixed case
gtag('event', '2nd_step_done'); // starts with a digit
gtag('event', 'newsletter-signup', { 'plan-type': 'free' }); // hyphensThe first call in the invalid block sends a name with spaces. Treat it as broken even if you see it appear in a report. Names that do not follow the format are not guaranteed to be processed.
Reserved names
GA4 reserves some names for itself. If you send them from your own code, the event or parameter may be ignored or may corrupt the meaning of the automatic data.
Reserved event names
These event names cannot be used for custom events:
ad_activeview,ad_click,ad_exposure,ad_impression,ad_query,adunit_exposureapp_clear_data,app_install,app_remove,app_updateerror,first_open,first_visit,in_app_purchasenotification_dismiss,notification_foreground,notification_open,notification_receiveos_update,screen_view,session_start,user_engagement
Check the current reserved list in the official GA4 documentation when you design a name. Google updates it as the product changes.
Reserved prefixes
Event names, parameter names, and user property names must not start with google_, ga_, or firebase_. A name like ga_signup looks harmless but breaks this rule.
Names that clash with automatic events
Names such as click, scroll, file_download, and page_view are not in the reserved list, but GA4 or enhanced measurement already collects them. If you send your own scroll event, you get two events with the same name and different meanings. Pick a distinct name instead, for example article_read_75.
Recommended names are an exact-match contract
The recommended events are a different case. You are meant to use their names, such as login, sign_up, purchase, and add_to_cart. The name must match exactly. Login, log_in, and user_login are custom events, and GA4 gives them none of the special handling that login gets.
Limits
The quotas that matter most when you design events are below.
| Item | Standard property | GA4 360 property |
|---|---|---|
| Event name length | 40 characters | 40 characters |
| Parameter name length | 40 characters | 40 characters |
| Parameter value length | 100 characters | 500 characters |
| Parameters per event | 25 | 25 |
| Distinct event names (custom, per app instance or browser) | 500 | 2,000 |
| User property name length | 24 characters | 24 characters |
| User property value length | 36 characters | 36 characters |
| User properties per property | 25 | 100 |
| Event-scoped custom dimensions | 50 | 125 |
| User-scoped custom dimensions | 25 | 100 |
| Item-scoped custom dimensions | 10 | 25 |
| Custom metrics | 50 | 125 |
Values change over time, so confirm them against the Analytics Help page on collection limits before you commit to a design.
What happens when you hit a limit
- A parameter value longer than the limit is truncated or dropped. It does not fail loudly.
- Parameters beyond the 25-per-event cap are not collected. Which ones are dropped is not something you control.
- Once you pass the distinct event name quota, new event names are not collected. This is why generating names dynamically, such as
click_followed by a product ID, is a serious mistake. - The quotas for custom dimensions and metrics apply to registrations in the Admin area, not to what you send. Chapter material on registering definitions covers that step.
Parameters that have higher limits
A few built-in parameters have larger length limits than the general 100-character rule. For example, page_location, page_referrer, and page_title accept longer strings than a custom parameter would. Do not assume a custom parameter gets the same allowance.
Names that carry data
A common mistake is putting a changing value into the event name. Compare these two approaches.
// Bad: one event name per product creates unbounded event names
gtag('event', 'clicked_trail_shoes_banner');
gtag('event', 'clicked_rain_jacket_banner');
// Good: one event name, the variable part goes in a parameter
gtag('event', 'banner_click', {
banner_name: 'trail_shoes'
});The second pattern keeps the event count low and lets you break down by banner_name once you register it as a custom dimension. A rule of thumb: if a value can take more than a handful of forms, it belongs in a parameter.
Parameter values also must not contain personally identifiable information such as email addresses, phone numbers, or full names. Google's terms forbid sending PII to Analytics, and a leaked value cannot be fully removed afterward. Hash or omit it, and prefer an internal ID that you can look up on your own systems.
A name-checking routine
You can check a name against the format rules before you ship it. The following Node.js function tests a name for the format, the reserved prefixes, and the reserved event list.
const RESERVED_EVENTS = new Set([
'ad_activeview', 'ad_click', 'ad_exposure', 'ad_impression', 'ad_query',
'adunit_exposure', 'app_clear_data', 'app_install', 'app_remove',
'app_update', 'error', 'first_open', 'first_visit', 'in_app_purchase',
'notification_dismiss', 'notification_foreground', 'notification_open',
'notification_receive', 'os_update', 'screen_view', 'session_start',
'user_engagement'
]);
const RESERVED_PREFIXES = ['google_', 'ga_', 'firebase_'];
function checkEventName(name) {
const problems = [];
if (!/^[A-Za-z][A-Za-z0-9_]*$/.test(name)) {
problems.push('use only letters, numbers, underscores, starting with a letter');
}
if (name.length > 40) problems.push('longer than 40 characters');
if (name !== name.toLowerCase()) problems.push('not lowercase snake_case');
if (RESERVED_PREFIXES.some((p) => name.startsWith(p))) {
problems.push('uses a reserved prefix');
}
if (RESERVED_EVENTS.has(name)) problems.push('reserved event name');
return problems;
}
for (const n of ['banner_click', 'Banner Click', 'ga_signup', 'session_start']) {
const result = checkEventName(n);
console.log(n, '->', result.length ? result.join('; ') : 'ok');
}Running it prints ok for banner_click and a list of problems for the other three. You can run the same check in a continuous integration job against your tracking plan file so that bad names never reach production.
The decision flow for a new name
Common errors
- Case drift. One developer writes
formSubmit, another writesform_submit. You then have two events, and reports split the counts. Fix this by publishing one naming convention and enforcing it in review. - Dynamic names. Names built from IDs, URLs, or timestamps exhaust the distinct event name quota. Put those values in parameters.
- Wrong parameter on a recommended event.
purchaseexpectstransaction_id,value, andcurrency. Writingrevenueinstead means GA4 does not recognize it as the purchase value. - Over-long values. A
page_title-style string of 150 characters in a custom parameter is cut at 100. - Renaming later. You cannot rename a collected event. Changing a name starts a new event with no history. You can create modified events in the GA4 interface to rename or copy events, but that works only on data going forward.
Exercise
A developer wants to track clicks on each product card and proposes event names click_SKU_123, click_SKU_456, and so on, one per product. Name two problems with this design and write the corrected gtag call.
Show answer
The names are dynamic, so with a large catalog they will exhaust the distinct event name quota (500 on a standard property), and the mixed case makes names inconsistent with snakecase convention. The corrected design uses one event with the variable value in a parameter: gtag('event', 'productcardclick', { itemid: 'SKU123' }); You then register itemid as an event-scoped custom dimension to report on it.
Exercise
You send gtag('event', 'Login', { method: 'Google' }) and the recommended Login behavior does not appear in reports. What is wrong, and what do you change?
Show answer
Event names are case-sensitive, and the recommended event is the lowercase login. Capital-L Login is treated as a separate custom event. Change the call to gtag('event', 'login', { method: 'Google' }).