Sub topic 7
Naming Rules, Reserved Names, and Limits in GA4
Assume you know the basic GA4 event model, can read JavaScript objects, and have access to a GA4 property or test property. Naming is part of implementation design. A valid name helps GA4 process data consistently. An invalid or conflicting name can prevent an event from appearing as expected.
Rules for event and parameter names
GA4 event and parameter names are case-sensitive. video_start, Video_Start, and VIDEO_START are different names. Use lowercase snake_case to avoid accidental duplicates.
Follow these rules:
- Start the name with a letter.
- Use only letters, numbers, and underscores.
- Do not use spaces, hyphens, or punctuation.
- Keep event names to 40 characters or fewer.
- Keep parameter names to 40 characters or fewer.
- Do not use reserved names or reserved prefixes.
- Use a stable name for one meaning. Do not use
signupfor several unrelated actions. - Avoid personally identifiable information, such as email addresses, in event names or parameter values.
Parameter values have their own limits. For example, an event can include no more than 25 custom parameters. A long description should usually be sent as a shorter category or identifier instead of being placed in an event parameter.
| Name | Good choice | Problem |
|---|---|---|
| Event name | `newsletter_signup` | `Newsletter Signup` uses spaces and inconsistent capitalization |
| Parameter name | `plan_type` | `plan-type` uses a hyphen |
| Parameter value | `free` | A full paragraph creates unnecessary data |
| Event name | `tutorial_complete` | `tutorial complete` is invalid |
Reserved names and prefixes
GA4 reserves names used by the platform, SDKs, and measurement features. Examples include page_view, session_start, first_visit, user_engagement, and ad_impression. These names describe events that GA4 or an integration may already generate. Do not create a custom event that imitates one of them.
GA4 also reserves prefixes such as:
google_ga_firebase_
For example, ga_article_view is a poor custom name even if it passes the character check. A reserved prefix can cause rejection or create confusion about which system owns the event.
Recommended event names also have special meaning. Use sign_up instead of inventing account_created when measuring registration, provided the recommended event fits the action. Do not add a custom event merely to change the capitalization of an existing event.
A naming workflow
Use this sequence for every new event:
- Describe the user action in plain language.
- Check whether an automatically collected or recommended event already represents it.
- Convert the name to lowercase
snake_case. - Check characters, length, reserved names, and reserved prefixes.
- Define only parameters that add useful context.
- Record the final name and meaning in the tracking plan.
gtag('event', 'newsletter_signup', {
placement: 'footer',
plan_type: 'free'
});Here, newsletter_signup identifies the action. The parameters describe where the action happened and which plan the user selected. Neither parameter should contain an email address or other personal identifier.
Exercise
Is GA-Newsletter Signup a suitable custom event name? If not, propose a valid replacement.
Show answer
No. It contains uppercase letters, a hyphen, and a space. Use newsletter_signup instead.