Sub topic 3
Scopes and why some fields cannot be combined
This chapter assumes you know what a GA4 event is, can tell a dimension from a metric, and have used the standard reports. You should also have access to a property with at least Viewer permissions. By the end you should be able to name the scope of a field, predict whether two fields will work together, and fix the grayed-out and misleading results that scope mismatches cause.
What a scope is
A scope says which part of the data model a field describes. GA4 stores every interaction as an event, so each field is tied to one of these levels:
- Event scope. The field describes a single event. Examples are
eventName,pagePath(Page path and screen class),eventCountandeventValue. - Session scope. The field describes a whole visit, such as the channel that started it. Examples are
sessionDefaultChannelGroup,sessionSource,sessionsandengagedSessions. - User scope. The field describes a person or device across visits. Examples are
newVsReturning,firstUserSource,totalUsersandactiveUsers. - Item scope. The field describes a product in an e-commerce event. Examples are
itemName,itemRevenueanditemsPurchased.
The scope is part of how a field is defined. In the Explore interface it is visible in the field's name. "Session default channel group" is a session-scoped version of channel. "First user default channel group" is a user-scoped version, and "Default channel group" is event-scoped.
Many concepts exist at several scopes. Source, medium and campaign each come in event, session and first-user versions. They can give different numbers for the same traffic, because they answer different questions.
| Field | Scope | Question it answers |
|---|---|---|
| Source | Event | Which source was attached to this event? |
| Session source | Session | Which source started this session? |
| First user source | User | Which source first acquired this user? |
Why scope matters for combining fields
Think of each scope as a table at a different grain. Events are the finest grain. A session groups many events. A user groups many sessions. Each metric is counted at its own grain. sessions counts sessions, eventCount counts events, and totalUsers counts distinct users.
When you put a dimension next to a metric, GA4 has to attribute the metric to each dimension value. That works cleanly when the dimension is at the same grain or a coarser one that every row of the metric belongs to. It fails when the dimension describes something that only exists on some of the rows.
Here is an example. sessions is a session-level count. The dimension eventName is event-scoped, and one session can contain many different event names. The question "how many sessions does the page_view event have?" has an answer, but "how many sessions does each event name have, adding up to the total?" does not. A session would be counted under every event name it contained, so the rows would not sum to the total. For cases like this, GA4 limits which combinations are allowed.
Compatibility rules
The rules below are the practical version of what GA4 enforces. They describe common cases, and the authoritative list for any one pair of fields is the Dimensions & metrics explorer in the GA4 developer documentation.
- Event-scoped metrics work with almost any dimension.
eventCountcan be broken down by session, user or event dimensions, because every event belongs to one session and one user. - Session-scoped metrics work with session and user dimensions.
sessionsbysessionDefaultChannelGroupis valid.sessionsbydeviceCategoryis also valid, because each session has one device category. - Session-scoped metrics do not work with most event-scoped dimensions. The example above,
sessionsbyeventName, is the usual failure. Page-level dimensions have the same problem, although some combinations are allowed because GA4 defines specific exceptions. - User-scoped metrics work with user-scoped dimensions.
totalUsersbynewVsReturningis fine. - Item-scoped fields belong together. Item dimensions such as
itemNameare compatible with item metrics. Mixing item metrics with unrelated event dimensions often removes the item values or marks the pair incompatible. - Custom dimensions follow their registered scope. A custom dimension registered at event scope behaves like an event-scoped field. One registered at user scope behaves like a user-scoped field.
Two fields can also be incompatible for reasons other than scope. Some dimensions only apply to certain events, and some metrics only exist for certain feature areas, such as advertising or e-commerce.
How Explore shows incompatibility
In a Free-form exploration, incompatibility is visible while you build the report. After you add a field to the Tab Settings panel, GA4 grays out the fields that no longer work with your selection. Hovering over a grayed-out dimension or metric in the Variables panel shows a message that it is incompatible with something already in use.
This has three consequences you should know about.
- Order matters. The first fields you add decide which others remain available. If you add
eventNamefirst, session-scoped metrics may be grayed out. Add the metric you care about most first, and the usable dimensions stay available. - Removing a field can restore others. If a field you need is grayed out, remove the field that blocks it. You can then see which of the remaining fields is the real source of the conflict.
- The warning is about the whole table. A field is grayed out if it conflicts with any dimension, metric or filter in the tab, not only with the one next to it.
The same applies to segments and filters. A segment defined with event conditions can limit which metrics and dimensions you can use. A filter on an event-scoped dimension can interact badly with a session-scoped metric.
Scope mismatches that do not raise errors
Gray-out protects you from the worst cases, but some mismatches produce a number that looks fine and means something different from what you expected.
Session versus event channel. A user may arrive through one channel, leave, and return through another. A report of eventCount by event-scoped defaultChannelGroup attributes each event to the channel in force when the event was recorded. A report of sessions by sessionDefaultChannelGroup attributes each session to the channel that started it. The totals are the same, but the channel breakdown differs.
First-user versus session source. First user source stays the same for a person for the life of their data. If you pair it with sessions, you are asking how many sessions came from users who were originally acquired by each source. This is a valid retention-style question. It is a different question from "which source drove each session".
Users in a session-scoped table. totalUsers counts distinct users per row. Add a row for each device category, and the same person using a phone and a laptop appears in both rows. The rows then add up to more than the grand total. This is expected for distinct counts and is not a bug.
Segments and scope. Segments in Explore can be user, session or event scoped. A user segment includes all of a matching user's events in the date range. A session segment includes only the sessions that match. An event segment includes only the matching events. Choosing the wrong scope changes the numbers while still producing a valid table.
A short diagnosis routine
When a table looks wrong or a field is grayed out, work through these steps.
- List the scope of every dimension, metric, segment and filter in the tab.
- Find the metric with the narrowest meaning, usually a session or user count. Check that each dimension is at the same scope or a coarser one.
- Look for event-scoped dimensions next to session or user metrics. Replace them with a session or first-user equivalent if one exists.
- If rows do not add up to the total, check whether the metric is a distinct count such as users.
- If the numbers differ from a standard report, compare the scope of the standard report's fields with yours.
The routine can also be shown as a decision flow.
Example: choosing the right channel field
Suppose you want to know which channels drive engaged sessions. You build a table with sessionDefaultChannelGroup as rows and engagedSessions and sessions as values. Every field is session scoped, so the table is valid and the numbers match the Traffic acquisition report.
Now you add eventName as a column. The session metrics are grayed out or the table stops matching, because the event name is event scoped. The fix is to keep the session-scoped table, and to build a second tab with eventCount by eventName when you need event detail. Use a segment if you only want to look at sessions that contain a specific event.
Exercise
A table shows sessions by Session default channel group. You add the dimension Event name and the Sessions metric is grayed out. Why does this happen, and what can you do to answer "which channels produce sessions with a purchase event"?
Show answer
Sessions is session scoped and Event name is event scoped. One session contains many event names, so GA4 cannot assign each session to a single event name without counting it several times. Remove Event name and create a session segment with the condition "Event name exactly matches purchase". Apply the segment to the table, then compare sessions by Session default channel group.
Exercise
You build one table with Total users by Device category and the rows add up to more than the grand total. Is this an error?
Show answer
No. Total users is a distinct count, and one person who used both a phone and a laptop is counted in each device row but only once in the grand total. The rows can therefore exceed the total.