Sub topic 5
Defining Steps and Conditions
This chapter assumes you can open a GA4 property, know that GA4 records behavior as events with parameters, and have at least Analyst access (or the demo property). You should also have seen the Funnel exploration template. Here you will build the step list that the rest of the funnel depends on.
What a step is
A step is a rule that decides whether a user (or session) has done a particular thing. GA4 evaluates each user against the rules in order and counts how many satisfy each one. A step has three parts:
- A name that appears in the visualization and table.
- One or more conditions that define the action.
- Settings for how it relates to the previous step, covered in a later chapter (directly or indirectly followed by, and time limits).
Everything about a funnel's numbers comes from these rules. A vague step produces a vague funnel. A step that matches events you never collect produces an empty one.
Opening the step editor
In Explore, create a Funnel exploration, then click the pencil icon beside Steps in the Variables column. The template starts with sample steps. You can edit, delete or reorder them. The editor lets you:
- Add a step with Add step.
- Rename a step by typing in its name field.
- Drag steps to change their order.
- Toggle Make open funnel (explained in the next chapter).
- Toggle Show elapsed time, which adds average time between steps to the results.
Give steps short, business-readable names such as "View item" or "Add to cart". Those names appear in the chart and in exports. Reports read by non-analysts should not show raw event names.
Conditions: events, parameters and dimensions
Each step contains one or more conditions. A condition picks something to test, and a value to match.
- Click Add new condition in a step.
- Choose a dimension. The most common is Event name. You can also choose a page path, page title, event parameter, user property, or another dimension.
- Choose a match type, such as "exactly matches", "contains", "begins with", or "matches regex".
- Enter the value.
For an ecommerce purchase journey, the simplest funnel uses one condition per step, each on Event name:
| Step | Condition |
|---|---|
| View item | Event name exactly matches `view_item` |
| Add to cart | Event name exactly matches `add_to_cart` |
| Begin checkout | Event name exactly matches `begin_checkout` |
| Purchase | Event name exactly matches `purchase` |
These event names come from the recommended ecommerce events. The matching instrumentation looks like this:
gtag('event', 'view_item', {
currency: 'USD',
value: 29.99,
items: [{ item_id: 'SKU_123', item_name: 'Canvas Tote', price: 29.99 }]
});
gtag('event', 'add_to_cart', {
currency: 'USD',
value: 29.99,
items: [{ item_id: 'SKU_123', item_name: 'Canvas Tote', price: 29.99, quantity: 1 }]
});
gtag('event', 'begin_checkout', {
currency: 'USD',
value: 29.99,
items: [{ item_id: 'SKU_123', item_name: 'Canvas Tote', price: 29.99, quantity: 1 }]
});
gtag('event', 'purchase', {
transaction_id: 'T_12345',
currency: 'USD',
value: 29.99,
items: [{ item_id: 'SKU_123', item_name: 'Canvas Tote', price: 29.99, quantity: 1 }]
});The step editor can only select what GA4 has collected. If an event has not fired in the property recently, you may not see it in the drop-down. You can usually still type the name, but the step will count zero users until the event arrives.
Adding parameter conditions
An event name alone is often too broad. A page_view step matches every page. To narrow it, add a second condition to the same step, using a parameter.
Examples:
page_viewwhere Page path contains/checkout/shipping.select_contentwherecontent_typeequalsvideo.generate_leadwhereform_idequalsnewsletter.
An event parameter appears in the condition drop-down only if it is registered as a custom dimension (or is a standard dimension GA4 already exposes). If your funnel needs form_id, register it first in Admin > Custom definitions. Registration only applies from that point on, so earlier data will not contain the dimension.
AND and OR within a step
Conditions inside a step can be combined in two ways:
- AND requires all conditions to hold on the same event. For example, the event is
page_viewAND the page path contains/checkout. - OR allows any one of several alternatives. For example, the event is
purchaseOR the event issubscribe.
Use OR when the same business milestone can be reached in more than one way. Use AND to tighten a broad event.
Be careful with AND. Conditions in a step are checked together on a single event. If one condition is about an event and another is about a user property, the user property is read at the time of that event. Two different events cannot satisfy two ANDed conditions.
Choosing the right granularity
The same journey can be defined in different ways. Pick the one that matches the question you are asking.
| Approach | Example | Good for | Risk |
|---|---|---|---|
| Event name only | `add_to_cart` | Quick overview | Mixes different products and contexts |
| Event + parameter | `add_to_cart` with `item_category` = Bags | One product line | Needs the parameter to be registered |
| Page-based | `page_view` where path contains `/cart` | Sites without ecommerce events | Breaks when URLs change |
| OR group | `purchase` or `subscribe` | Multiple success paths | Can hide differences between paths |
Prefer events over page paths when both are available. Events survive redesigns, while paths often change.
A worked example
Suppose you want to see how many people move from product view to purchase, but only for the Bags category.
- Open Explore and choose the Funnel exploration template.
- Click the pencil icon beside Steps.
- Create four steps named "View item", "Add to cart", "Begin checkout" and "Purchase".
- In each step, add the event-name condition from the table above.
- In the first step, add an AND condition: Item category exactly matches
Bags. - Click Apply.
Now check the numbers. The first step shows how many users viewed a bag. The later steps show how many of those went on to the next action. If the later steps look implausibly small, the item category may not be sent with every event. Item-scoped dimensions only exist on events that carry an items array. A purchase sent without items cannot match an item category condition.
Tips for reliable steps
- Keep step counts reasonable. A funnel can have up to ten steps, and most useful funnels have between three and six.
- Make the first step the real entry point. If it is too broad, every later percentage is diluted.
- Use the same condition style across steps so the results are comparable.
- Test each condition on its own. Build a one-step funnel first and confirm the number matches the event count in a standard report, then add steps.
- Be aware that a step's users are counted from the set of users who satisfy the whole funnel path, not from all users who ever did that event. In a closed funnel, "Add to cart" counts only users who also passed "View item".
Common mistakes
- Typing an event name with the wrong case. Event names are case-sensitive, so
Add_To_Cartis a different event fromadd_to_cart. - Using "contains" where "exactly matches" is needed.
purchasealso matchespurchase_refundif both exist. - Using a parameter that is not registered. The condition is unavailable, or counts nothing.
- Putting two events in one step with AND. A single event cannot be both
view_itemandadd_to_cart. Use OR, or separate steps. - Forgetting that the step list defines order. Steps are evaluated in the order shown, so a step placed in the wrong position changes the meaning of the funnel.
Exercise
A funnel step is defined as "Event name exactly matches purchase AND Event name exactly matches subscribe". It always shows zero users. Why, and how would you fix it if either action counts as success?
Show answer
Conditions joined by AND must all be true on the same event, and one event cannot have two different names. Put the two conditions in separate OR groups within the step, so the step matches users who triggered either purchase or subscribe.
Exercise
You add a condition "Item category exactly matches Bags" to the Purchase step, and the step count drops to zero even though bag sales exist. What is a likely cause?
Show answer
The purchase event is probably sent without an items array, or without item_category inside it, so the item-scoped dimension has no value to match. Fix the instrumentation to include items on purchase, or apply the category condition only on steps whose events carry items.