Sub topic 13
Naming Conventions and Documentation
Assume you know the GA4 interface, understand events and event parameters, and can send data with JavaScript or Google Tag Manager. This chapter focuses on keeping custom definitions understandable as your property grows.
Separate the parameter key from the display name
A parameter key is the name sent with an event, such as plan_tier. A display name is the human-readable name shown in GA4, such as “Plan tier.”
Keep parameter keys stable. Reports, BigQuery queries, and Data API requests depend on the key. You can improve a display name later without changing the data collection code.
Use lowercase snake_case for keys:
plan_tierbilling_cyclecustomer_typevideo_length_seconds
Avoid keys that are vague, temporary, or tied to one campaign:
value2new_fieldhomepage_test_a
A good name describes the meaning, not the current implementation. Prefer subscription_status over button_color when the value represents a business state.
Use a consistent data dictionary
A data dictionary is a record of the custom data your property collects. Store it in a shared document or source-controlled file. Record the sending key, scope, values, and intended use.
| Key | Scope | Example value | Type or unit | Description |
|---|---|---|---|---|
| `plan_tier` | Event | `pro` | Text | Plan selected during signup |
| `customer_type` | User | `subscriber` | Text | Current customer classification |
| `video_length_seconds` | Event | `184` | Seconds | Length of the completed video |
Document allowed values whenever possible. For example, define plan_tier as free, pro, or enterprise. Do not send Pro, professional, and paid for the same concept. Consistent values make filters, audiences, and comparisons reliable.
gtag('event', 'select_plan', {
plan_tier: 'pro',
billing_cycle: 'annual'
});For each field, document:
- The business meaning.
- The event or user property that sends it.
- The custom definition scope.
- The expected data type and unit.
- Allowed values and capitalization.
- The owner responsible for changes.
- Reports, audiences, or exports that depend on it.
Name custom definitions for readers
In Admin > Data display > Custom definitions, use display names that a report reader can understand without seeing implementation code.
Good names include:
- Plan tier
- Billing cycle
- Customer type
- Video length
Include the scope in the description, especially when similar fields exist. For example:
> Event-scoped value showing the plan selected in the signup flow. Allowed values: free, pro, enterprise.
Do not put changing campaign names, dates, or team abbreviations in a definition name. If the meaning changes, create a new parameter and definition rather than silently reusing the old one.
Review privacy and cardinality
Do not send names, email addresses, phone numbers, customer IDs, or other personally identifiable information (PII) in custom dimensions. Use a category such as customer_type, not an individual identifier.
Avoid values with thousands of unique possibilities, such as search queries, timestamps, or order IDs. These create high-cardinality dimensions that are difficult to analyze and may be grouped as (other) in reports.
A review checklist should ask:
- Is the field needed for a documented business question?
- Is its scope correct: event, user, or item?
- Are values limited and consistently formatted?
- Could the value identify a person?
- Will the definition name make sense to someone outside the implementation team?
Exercise
You need to track the selected checkout method. Which key is better: field7 or checkout_method, and what values should you document?
Show answer
Use checkout_method. Document a controlled set such as card, paypal, and bank_transfer, including the event scope and the reports that use it.