Sub topic 5
Choosing the Right Scope for Each Condition
Assume that your GA4 property collects events correctly and that you understand events, event parameters, user properties, and basic audience conditions. Scope determines where GA4 looks for each condition: in one event, in one session, or across a user's sessions.
The three condition scopes
GA4 provides three main scopes for audience conditions:
| Scope | GA4 checks | Typical use |
|---|---|---|
| Within the same event | Parameters on one event | Users who added a specific product to their cart |
| Within the same session | Multiple events during one session | Users who viewed a product and then added it to a cart |
| Across all sessions | A user's activity over multiple sessions | Users who visited before purchasing later |
An event is a single recorded action, such as view_item or add_to_cart. A session is a group of activity from one user within a period of activity. A user can have many sessions.
Within the same event
Use this scope when all related filters describe one event. For example, you might want users whose add_to_cart event has a product worth more than $25.
The event parameters must belong to the same event instance:
gtag('event', 'add_to_cart', {
currency: 'USD',
value: 29.99,
items: [
{
item_id: 'SKU_123',
item_name: 'Trail Shoes',
price: 29.99,
quantity: 1
}
]
});If you combine event_name = add_to_cart with value > 25, the value filter describes that same add_to_cart event. Register a custom dimension or metric when the parameter is not available in the audience builder.
Within the same session
Use this scope when different events must occur during one visit. For example:
- The user viewed a product.
- The user then added a product to the cart.
The events do not need to happen at the same moment. They only need to occur within the same session. This scope is useful for short funnel steps where the user's intent should be connected to one visit.
Across all sessions
Use this scope when conditions can occur at different times. For example:
- The user visited the pricing page.
- The user returned several days later.
- The user completed a purchase.
Choose this scope when the audience represents a user relationship rather than one visit. It is often appropriate for lifecycle audiences, such as users who have not purchased yet or users who purchased in the past.
Combining conditions and scopes
When building an audience, decide whether conditions should be joined with AND or OR.
Use AND when every condition must be true. Use OR when any condition can be true. Apply the narrowest scope that matches the business question. A session-scoped condition can accidentally connect events from separate visits if you use the broader all-sessions scope.
Common scope errors
- Using event scope for conditions that require two separate events. One event cannot also be a later event.
- Using session scope for a long sales cycle. Returning users may be excluded even when they eventually convert.
- Using all-sessions scope for a single-visit funnel. Unrelated visits may satisfy the conditions.
- Filtering on an unregistered custom parameter. The event may contain the parameter, but the audience builder may not be able to use it until you register the matching custom definition.
Exercise
You want an audience of users who viewed a product during one visit and added that product to the cart during the same visit. Which scope should you choose?
Show answer
Choose “within the same session.” The two actions are separate events, but they must occur during one session.