Sub topic 5
Choosing the right scope for each condition
This chapter assumes you can open the audience builder, add an event condition, and know the difference between an event parameter and a user property. It also assumes the parameters you want to filter on are registered as custom dimensions, which the earlier chapter on custom definitions covers. Here you will learn what a condition's scope controls, how each of the three scopes behaves, and which scope to pick for a given goal.
What scope means
A condition group in the audience builder has a scope. The scope answers one question: how close together in time must the conditions in this group be satisfied?
GA4 offers three scopes:
- Across all sessions. The conditions can be met at any time, on any event, during the membership window. This is the default.
- Within the same session. All conditions in the group must be met in one session.
- Within the same event. All conditions in the group must be met by one single event.
Scope applies to the AND logic inside a group. It does not change how separate groups combine, and it does not change how an exclusion works. Most unexpected audience results come from the wrong scope, not from wrong conditions.
Within the same event
Use this scope when the conditions describe one action. A parameter filter such as plan_name = pro only makes sense attached to a particular event, so the builder treats the event name and its parameters as a unit.
Consider the custom event from the data model chapter:
gtag('event', 'select_plan', {
plan_name: 'pro',
billing_period: 'annual'
});Suppose you want users who chose the annual Pro plan. You need an event condition and two parameter conditions to hold on the same event:
- Event name equals
select_plan plan_nameequalsprobilling_periodequalsannual
Scope this group as within the same event. A user who sent select_plan with plan_name: 'pro' and billing_period: 'monthly' does not qualify. Neither does a user whose Pro selection and annual selection came from two different events.
Now consider what happens with the wrong scope. Say a visitor first selected the monthly Pro plan, then later selected the annual Basic plan. Under across all sessions, the builder can look at those conditions separately. Pro was seen on one event and annual on another, so the visitor can match even though they never chose annual Pro. The audience then includes people you did not intend to reach.
The same-event scope also depends on registration. If plan_name is not registered as an event-scoped custom dimension, it does not appear as a filter in the builder, and you cannot express this condition at all.
Within the same session
Use this scope when the conditions describe one visit, but the actions are different events. A typical case is a shopper who views a product and starts checkout in the same visit.
- Event name equals
view_item - Event name equals
begin_checkout
Scoped to the session, this group matches only users who did both in one visit. Two visits do not count, even if each visit contained one of the events.
Session scope is also a good fit for engagement conditions that only mean something per visit, such as "viewed three or more pages in a session". It does not enforce order. A user who started checkout and then viewed an item in the same session still matches. If order matters, you need a sequence, which a later chapter covers.
Across all sessions
This scope describes accumulated behavior. The conditions can be met on different days, with each condition satisfied at some point inside the membership duration.
- Event name equals
purchase valueis greater than 100 (on any purchase event)
Across all sessions, a user qualifies if they have ever purchased and also, at some point, had a qualifying event. If you need the value on the purchase event itself, that is a same-event requirement, and across-sessions scope is the wrong choice.
This scope is the natural choice for audiences like "users who visited the pricing page and also read three blog posts". The two behaviors are related but do not need to happen together.
Comparing the three scopes
| Scope | All conditions must be met by | Typical use | Common mistake |
|---|---|---|---|
| Within the same event | One single event | Event plus parameter filters, such as `select_plan` with `plan_name = pro` | Forgetting to register the parameter as a custom dimension |
| Within the same session | One visit, possibly several events | View and checkout in the same visit | Assuming the scope enforces the order of events |
| Across all sessions | Any events in the membership window | Lifetime or long-window behavior | Expecting parameters to stay tied to one event |
A worked example: add to cart without purchase
The add_to_cart event carries a value and an items array:
gtag('event', 'add_to_cart', {
currency: 'USD',
value: 29.99,
items: [{ item_id: 'SKU_123', item_name: 'Trail Shoes', price: 29.99, quantity: 1 }]
});Suppose you want to remarket to people who added a cart worth at least 50 USD, but did not buy.
- Create an include group with the event
add_to_cart. Add the parameter conditionvaluegreater than or equal to 50. Scope this group within the same event, because the cart value must belong to the add-to-cart event itself. - Add an exclusion for the
purchaseevent. Exclusions have their own behavior, which the next chapter covers.
Had you picked across all sessions for step 1, the value condition would not be tied to the add-to-cart event. A user could qualify through a large value on one event type and an unrelated cart event. Choosing the narrowest scope that matches your intent keeps the audience precise.
Choosing scope: decision rules
Start from the narrowest scope that matches your intent, then widen only if the audience comes out too small.
- If a parameter filter must apply to a specific event, use same event.
- If the actions must happen in one visit and the order does not matter, use same session.
- If the behavior can be spread over days or weeks, use across all sessions.
- If order or timing between steps matters, do not rely on scope. Use a sequence.
Scope also affects size. A tighter scope matches fewer users, so a same-event audience is usually smaller than the same conditions across all sessions. That matters for remarketing, because Google Ads needs a minimum number of users before it serves ads to a list.
Common errors
- Wrong default accepted. The builder starts with across all sessions. If you never change it, parameter conditions may be satisfied by separate events.
- Unregistered parameter. The parameter is missing from the list, so you rebuild the condition on the event name alone and the audience becomes too broad.
- Session scope used for order. Session scope has no notion of before and after.
- Mixing user and event conditions. A user property such as
membership_tierbelongs to the user, not to an event. Combine it with event conditions in a group scoped to the whole user history, or in separate groups, and check the result in the audience summary.
Exercises
Exercise
You want an audience of users who selected the annual Pro plan. The select_plan event carries plan_name and billing_period. A user chose monthly Pro on Monday and annual Basic on Tuesday. Which scope keeps this user out of the audience, and why?
Show answer
Within the same event. Both parameter conditions must hold on one select_plan event. This user's two events each satisfy only one condition, so neither event qualifies on its own. Under across all sessions, the user would match because each condition is satisfied on some event.
Exercise
An audience requires view_item and begin_checkout, scoped within the same session. A user began checkout first and then viewed an item, all in one visit. Does the user qualify? What would you use if the order mattered?
Show answer
Yes, the user qualifies. Session scope requires only that both events occur in the same session and does not check order. If view must come before checkout, build a sequence condition.