Sub topic 12
Registering Custom Dimensions and Metrics So Parameters Appear in Reports
Assume you know the GA4 interface, event parameters, and basic JavaScript or Google Tag Manager. This chapter focuses on the reporting step after an event has been implemented and validated.
Collection and registration are separate steps
An event parameter is a value sent with an event. For example, plan_type might describe which subscription plan a user selected.
Sending a parameter does not automatically make it available in GA4 reports. You must register the parameter as a custom definition. A custom dimension reports text or category values. A custom metric reports numeric values that can be aggregated.
| Data type | Example parameter | Register as |
|---|---|---|
| Text or category | `plan_type: "pro"` | Event-scoped custom dimension |
| Number | `seats: 5` | Event-scoped custom metric |
| Number with a unit | `discount_amount: 12.50` | Event-scoped custom metric |
A custom definition is based on the parameter name, not on one particular event. If plan_type is sent with several events, the same event-scoped custom dimension can describe all of them.
Register an event-scoped custom dimension
First send the parameter with the event:
gtag('event', 'subscription_start', {
plan_type: 'pro',
billing_period: 'annual'
});In Google Analytics:
- Open Admin.
- Under Data display, select Custom definitions.
- Select Create custom dimensions.
- Enter a clear display name, such as
Plan type. - Set the scope to Event.
- Enter the event parameter name exactly as sent:
plan_type. - Add an optional description and save the definition.
The parameter name is case-sensitive. plan_type, Plan_Type, and planType are different names. Use one naming convention in your tracking plan and keep it consistent.
After processing, the dimension can be used in Explorations, comparisons, audiences, and other supported reporting features. Registration does not rename the parameter in collected data.
Register an event-scoped custom metric
Use a custom metric when the parameter contains a meaningful number:
gtag('event', 'tutorial_complete', {
tutorial_id: 'ga4-events-101',
lesson_count: 8,
completion_seconds: 214
});Create the definition from Admin > Data display > Custom definitions > Create custom metrics. Set the scope to Event, enter the exact parameter name, and choose an appropriate unit, such as Standard, Currency, Distance, or Time.
Choose a unit that matches the value. For example, use Seconds for completion_seconds. Do not send "eight" as a metric value. Send a number such as 8.
A useful validation sequence
The relationship between implementation and reporting is:
Check the event in DebugView first. Confirm the parameter name and value. Then confirm that the custom definition uses the same name and scope. Finally, allow processing time before judging whether the definition appears in reports.
Common errors include registering a text value as a metric, using a different spelling in the definition, expecting registration to backfill old data, and creating duplicate definitions for the same parameter.
Exercise
An event sends discount_code: "SPRING25" and discount_amount: 10.00. Which custom definitions should you create?
Show answer
Create an event-scoped custom dimension for discount_code and an event-scoped custom metric for discount_amount. Use a currency unit for the metric if the value represents money.