Sub topic 3
Using custom dimensions and metrics in reports and Explorations
This chapter assumes you have registered at least one custom dimension or metric in Admin, that your site or tag already sends the matching parameter, and that you can read the property's reports. You should know what a GA4 event and an event parameter are.
Using custom definitions in reports and Explorations
Reports and Explorations show a custom dimension under its display name, not its parameter name. In Explorations, add the dimension as a row or column in a free-form table. Custom metrics appear next to standard metrics such as Event count. Audiences can filter on custom dimensions as well.
Registration applies only to data collected after you register it. Events sent earlier never show the new definition.
Limits, processing delay and no retroactive data
Each property allows a fixed number of custom definitions per scope. Standard properties have, for example, 50 event-scoped custom dimensions and 25 user-scoped custom dimensions. Check the current limits in the Google documentation, because they change.
New definitions take up to about 48 hours to fill. GA4 does not backfill history. A parameter registered today shows no values for last month, so register definitions before a campaign starts.
Avoiding high cardinality and personal data
Cardinality is the number of distinct values a dimension holds. A dimension with millions of values, such as a session ID or a full URL with query strings, slows reports and groups most rows into "(other)". Use a small set of categories such as plan_tier instead.
Do not send personal data such as email addresses, names, or any identifier that points to a person. Google's policies prohibit sending it to GA4.
Naming conventions and documentation
Use lowercase snakecase for parameter names, such as `billingcycle`. Keep one name for each concept. Keep a shared table that lists each parameter, its scope, its unit, and its owner. Register each name exactly as your code sends it, because the Data API matches the exact string.
Querying custom definitions with the Data API and BigQuery
The Data API refers to an event-scoped dimension as customEvent: followed by the parameter name. User-scoped dimensions use customUser:, and item-scoped dimensions use customItem:.
{
"dateRanges": [{ "startDate": "28daysAgo", "endDate": "today" }],
"dimensions": [{ "name": "customEvent:plan_tier" }],
"metrics": [{ "name": "eventCount" }]
}In the BigQuery export, event parameters sit in the nested event_params field, and user properties sit in user_properties. You must unnest these fields in SQL before you can filter or group on them.
Exercise
A team registers the event-scoped dimension plantier today. Will events sent last month show plantier values in reports?
Show answer
No. GA4 does not backfill data, so only events collected after registration carry the dimension in reports. Older events show no value for it.