Web Analytics with Google Analytics 4The GA4 data model · Lesson 6 of 20
Custom definitions, scopes and core metrics
Video lecture
Custom definitions, scopes and core metrics
The narrated lecture is in production
Every chapter is scripted and ready. Browse the chapters and read the full transcript now — the video will appear here when it’s published.
Chapters
Transcript of the narration, chapter by chapter.
0:00 Custom definitions and metrics
Here's a frustrating moment every G A four user meets. Your developer sends a perfect parameter called author on every page view. You open the reports, and it isn't there. Anywhere. Nothing's broken. You've just discovered that collection is not reporting. In this lecture you'll learn how custom definitions work, how to choose the right scope, how to control cardinality so the dreaded other row doesn't swallow your data, the core metric definitions you must be able to explain, and how to audit definitions with the Data A P I.
0:39 Why it matters
Why does this matter? Because registration isn't retroactive. Data collected before you register a custom dimension won't appear under that dimension later. Register three weeks after launch, and you've lost three weeks. And definition slots are limited, with higher limits on the paid three sixty tier. So registering the right parameters, with the right scope, on day one, is one of the highest-leverage things an analyst does. It's also one of the most commonly forgotten.
1:12 Scopes
Here's the core idea: scope. Every custom definition describes something at a particular level. Event scope describes a single event occurrence, like form id, video title or author. User scope describes the user across events, like membership tier or customer type, and comes from a user property. Item scope describes a product inside the e-commerce items array, like color or size band. Think of it like labels in a supermarket. A label on the receipt, a label on the loyalty card, and a label on each product. Put the label in the wrong place, and it describes the wrong thing.
1:55 The classic mistake
The classic scope mistake: registering customer type as an event-scoped dimension. Then it only appears on events where it was explicitly sent, not across the user's whole behavior. So your report of purchases by customer type shows mostly not set. If an attribute describes the person, send it as a user property and register it with user scope. If it describes the action, it's event scope. And for product attributes inside the items array, use item scope.
2:28 Custom and calculated metrics
Custom metrics and calculated metrics are the numeric side. A custom metric registers a numeric parameter, like quote amount or reading time in seconds, so it can be summed or averaged. A calculated metric is a formula over existing metrics, like revenue per engaged session. Use calculated metrics when stakeholders keep computing the same ratio by hand in spreadsheets. It reduces errors and makes the definition visible to everyone.
2:58 Cardinality and (other)
Now cardinality, the number of unique values a dimension has. High-cardinality dimensions, like full URLs with query strings, unique ids, timestamps or free text, can make G A four group less common values into a row labeled other in some reports. To reduce the risk, band continuous values, like order value band fifty to one hundred. Strip unneeded query parameters. Keep ids out of general dimensions. And use explorations or the BigQuery export for granular analysis, where the other row doesn't apply.
3:34 Core definitions
And you must be able to explain the core metrics in plain language. Active users: distinct users who had an engaged session or certain first-time events, which is G A four's default users in most reports. New users: first-time visitors. Sessions. Engaged sessions. Engagement rate. Average engagement time, when the page was in focus. Key events. Session key event rate, the share of sessions with at least one key event. And total revenue, net of refunds depending on setup. Always name the metric precisely, active users, not just users.
4:13 Example 1: Riyadh news site
First example, a simple one. A news site in Riyadh wants to know which authors drive subscriptions. They add author and content group as parameters on page view, and register both as event-scoped custom dimensions. They register subscriber status, free, trial or paid, as a user-scoped dimension from a user property. Then, in a free-form exploration, rows are authors, columns are subscriber status, values are engaged sessions and subscribe key events. Now the editor can see which authors attract engaged readers who later subscribe.
4:50 Example 2: an online academy
Second example, a business case. An online academy sends course slug, lesson type and content language as event parameters on page view and on a custom lesson complete event. It sends learner plan, free or pro, as a user property. On launch day it registers three event-scoped dimensions and one user-scoped dimension. Within a month, one exploration shows which courses have high completion but low upgrade rates. That becomes the input to the next pricing experiment.
5:23 Watch me do it, part 1
Watch me audit definitions with the Data A P I. In the lesson's Python script, I create a client using application default credentials, so no keys in code. I call get metadata for the property and filter dimensions whose names start with custom event or custom user. That's my list of registered definitions. Then I run a small report: the author dimension with engaged sessions for the last seven days, limited to ten rows. I print the rows.
5:57 Watch me do it, part 2
The output shows the registered list, and the report shows a handful of authors, but most engaged sessions fall under not set. That tells me the definition is registered, but the parameter isn't being sent on every page view, probably only on article templates. I check with the developer, and it turns out the new video pages use a different template. They add the parameter, and a week later not set drops to a sliver. The A P I turned a vague feeling into a specific fix.
6:35 Definitions register
Keep a definitions register next to your tracking plan: name, scope, parameter, created date, owner, and where it's used. Treat slots as scarce, and retire unused definitions deliberately. It's a two-minute habit that saves hours when someone asks, six months later, why a dimension exists and whether it's safe to remove.
6:57 Common mistakes
Common mistakes. Registering definitions weeks after launch and losing early data. The wrong scope, especially user attributes registered as event scope. Using exact monetary amounts or ids as dimensions and then wondering why reports show other. And comparing users in G A four with visitors in another tool without explaining the definitions.
7:20 Recap
Recap. Custom parameters must be registered to be reported, and registration isn't retroactive. Choose the right scope: event, user or item. Control cardinality by banding and keeping ids out. Explain metrics precisely, especially active users. Keep a definitions register. And use the Data A P I, or BigQuery, to audit what's actually arriving.
7:43 Try this now
Try this now. Create a definitions register for a site you know with at least four custom dimensions across event, user and item scopes, and justify each scope in one line. If you have API access, run the lesson's script to see what's registered and whether values are arriving, and investigate the biggest not set.
Collection is not reporting
GA4 will happily accept a custom parameter like plan_tier or author, but most standard reports and explorations will not show it until you register a custom definition. Registration is done in the property's admin area and is not retroactive — data collected before registration will not appear under that dimension. Register on day one of implementation.
Scopes
Every custom definition has a scope that determines what it describes:
| Scope | Describes | Example | Typical source |
|---|---|---|---|
| Event | A single event occurrence | form_id, video_title, author | Event parameter |
| User | The user across events | membership_tier, customer_type | User property |
| Item | A product in an e-commerce items array | item_color, item_size_band | Item parameter |
Choosing the wrong scope is a classic error. If you register customer_type as event-scoped, it will only appear on events where it was explicitly sent, not across the user's entire behavior.
GA4 limits how many custom dimensions and metrics a property can register (with higher limits in the paid GA4 360 tier). Treat slots as a scarce resource: document each one in your tracking plan and retire unused ones deliberately.
Custom metrics and calculated metrics
A custom metric registers a numeric parameter (for example quote_amount or reading_time_seconds) so it can be summed or averaged. A calculated metric is a formula over existing metrics (for example revenue per engaged session). Use them when stakeholders repeatedly compute the same ratio by hand.
Cardinality and the "(other)" row
Cardinality is the number of unique values a dimension has. High-cardinality dimensions — full URLs with query strings, unique IDs, timestamps, free-text inputs — can cause GA4 to group less common values into a row labeled (other) in some reports. To reduce the risk:
- Band continuous values (
order_value_band: 50_100) instead of sending raw numbers as dimensions. - Strip unneeded query parameters from page locations.
- Keep IDs out of general dimensions unless you need them for joins (and then prefer BigQuery export).
- Use explorations or the BigQuery export for granular analysis.
Core metric definitions you must be able to explain
| Metric | Plain-language definition |
|---|---|
| Users / Active users | Distinct users who had an engaged session or certain first-time events in the period; GA4's default "users" in most reports refers to active users |
| New users | Users interacting for the first time (first_visit / first_open) |
| Sessions | Periods of activity, started by session_start |
| Engaged sessions | Sessions over 10 seconds (adjustable), with a key event, or with 2+ page/screen views |
| Engagement rate | Engaged sessions / sessions |
| Average engagement time | Time the page was in focus in the foreground, averaged |
| Key events | Count of events marked as key events |
| Session key event rate | Share of sessions with at least one key event |
| Total revenue | Purchase, subscription and ad revenue minus refunds (depending on setup) |
Because GA4 counts active users by default, numbers can differ from tools that count every visitor. When presenting, always name the metric precisely ("active users", not just "users").
Worked example: publisher author analysis
A news site in Riyadh wants to know which authors drive subscriptions. The implementation:
- Add
authorandcontent_groupas event parameters onpage_view. - Register both as event-scoped custom dimensions.
- Register
subscriber_status(free, trial, paid) as a user-scoped dimension from a user property. - In a free-form exploration, rows = author, columns = subscriber_status, values = engaged sessions and
subscribekey events.
Now the editor can see which authors attract engaged readers who later subscribe — a much better editorial KPI than raw page views.
Governance for custom definitions
Maintain a definitions register alongside your tracking plan:
| Name | Scope | Parameter | Created | Owner | Used in |
|-----------------|-------|------------------|------------|----------|-------------------------|
| Author | Event | author | 2026-01-12 | Content | Editorial dashboard |
| Subscriber tier | User | subscriber_status| 2026-01-12 | Growth | Retention exploration |
| Size band | Item | item_size_band | 2026-02-03 | E-comm | Merchandising report |Hands-on: register definitions and check them programmatically
Register custom dimensions in Admin > Data display > Custom definitions (menu names change occasionally). For audits across many properties, the Google Analytics Data API can list what is registered and run a quick report to confirm values are arriving:
# pip install google-analytics-data
from google.analytics.data_v1beta import BetaAnalyticsDataClient
from google.analytics.data_v1beta.types import (DateRange, Dimension, Metric,
RunReportRequest, GetMetadataRequest)
PROPERTY = "properties/123456789"
client = BetaAnalyticsDataClient() # uses Application Default Credentials
meta = client.get_metadata(GetMetadataRequest(name=f"{PROPERTY}/metadata"))
custom = [d.api_name for d in meta.dimensions if d.api_name.startswith("customEvent:")
or d.api_name.startswith("customUser:")]
print("registered:", custom)
report = client.run_report(RunReportRequest(
property=PROPERTY,
dimensions=[Dimension(name="customEvent:author")],
metrics=[Metric(name="engagedSessions")],
date_ranges=[DateRange(start_date="7daysAgo", end_date="yesterday")],
limit=10,
))
for row in report.rows:
print(row.dimension_values[0].value, row.metric_values[0].value)If the report shows mostly (not set), the parameter is registered but not being sent on the events you expected.
Second worked example: an online academy's course dimensions
An education platform sends course_slug, lesson_type (article or video) and content_language as event parameters on page_view and a custom lesson_complete event, and learner_plan (free, pro) as a user property. It registers the three event-scoped dimensions and one user-scoped dimension on launch day. Within a month, one exploration shows which courses have high completion but low upgrade rates, which becomes the input to the next pricing experiment.
Common mistakes
- Registering definitions weeks after launch, losing early data.
- Wrong scope, especially user attributes registered as event scope.
- Using exact monetary amounts or IDs as dimensions and then wondering why reports show "(other)".
- Comparing "users" in GA4 with "visitors" in another tool without explaining the definitions.
Key takeaways
- Custom parameters must be registered as custom definitions to be reported, and registration is not retroactive.
- Choose the right scope: event, user or item.
- Control cardinality by banding values and avoiding IDs or free text in dimensions.
- Always name metrics precisely — GA4's default users are active users.
Check your understanding
Quick questions to lock in the lesson. They don’t count towards your certificate.
Put it into practice
Create a definitions register for a site you know with at least four custom dimensions across event, user and item scopes, justifying each scope.
Enrol for free to save your progress
Reading is always free. Enrol to keep your place, take the final assessment and earn a verifiable certificate.