Sub topic 9
Comparing user groups with segments
This chapter assumes you can already build a basic Path exploration. That means you know how to pick a node type and a starting or ending point, and you can expand nodes in the diagram. It also assumes you know the difference between users, sessions and events. Here you will learn how to apply segments to a path so you can compare groups of users instead of reading one blended diagram.
Why segments matter in a path
A path diagram without a segment shows everyone who matches your starting or ending point. That is a mix of new and returning visitors, mobile and desktop users, paid and organic traffic, and buyers and browsers. The most common path in that mix often describes nobody in particular.
A segment is a saved filter on users, sessions or events. In an exploration, you apply a segment to restrict which data feeds the diagram. The tree then shows only the paths of the people or sessions that fit the segment.
Segments help you answer questions such as:
- Do mobile users reach checkout by the same route as desktop users?
- Do users who arrived from a campaign browse differently from organic visitors?
- What do users who later purchased do after viewing a product page, compared with users who did not?
Where segments live in the exploration
Open the exploration and look at the Variables column on the left. It has three areas that matter here:
- Segments is the list of segments available to this exploration. You add them with the plus icon.
- Dimensions and Metrics feed other techniques and matter less for Path exploration.
- Settings (the middle column) holds the tab settings, including a Segment comparisons box.
To use a segment, you first import it into the exploration's Variables column. You then drag it into the Segment comparisons box in Tab Settings, or double-click it. Importing a segment does not filter anything by itself. Only segments placed in the comparison box change the diagram.
Three kinds of segments
When you create a segment in the exploration, you choose its scope. The scope decides which part of the data the segment keeps.
| Scope | What it keeps | Example condition |
|---|---|---|
| User segment | All events from users who meet the condition at any time in the date range | Users who triggered `purchase` |
| Session segment | All events from sessions that meet the condition | Sessions where `session_source` is `google` |
| Event segment | Only the events that meet the condition | Events where `page_path` contains `/blog/` |
The scope changes what you see in a path, so choose it with care.
A user segment for "users who purchased" keeps every event those users generated. That includes sessions where they only browsed, and sessions before they had any intent to buy. This is useful when you want to see how eventual buyers behave across their whole history. It can mislead you if you assume every path in the tree ended in a purchase.
A session segment is stricter. It keeps only sessions where the condition happened. A session segment for "sessions with a purchase" shows paths inside purchasing sessions only. This is usually closer to what people mean when they say "the path to purchase".
An event segment drops events that do not match. In a path, this removes whole steps from the diagram, which can make unrelated events look adjacent. Use it carefully and read the result as "paths among only these events".
Building a segment for path analysis
Follow these steps to create a session segment for mobile traffic.
- In the Variables column, click the plus icon next to Segments.
- Choose Session segment.
- Name the segment, for example
Session: mobile. - Click Add new condition and search for the dimension Device category.
- Set the condition to exactly matches
mobile. - Click Save and apply.
The segment now appears in the Variables column and is applied to the tab. Create a second segment for desktop in the same way. You can also use suggested or predefined segments, such as "Purchasers" or "Mobile traffic", when they match your question.
Conditions and sequences
A segment can contain several conditions combined with AND or OR. You can also add a sequence, which requires events to happen in a stated order. A sequence segment is useful when you need "users who viewed a product and then added it to the cart". Sequence segments are more complicated than simple condition segments. A mistake in the step order or the time window silently changes who is included.
Comparing segments side by side
You can place up to four segments in the Segment comparisons box. For Path exploration, the diagram shows the same tree, but the node volumes are split by segment, so you can compare the groups at each step.
Note that the exact behavior depends on your interface version. In Path exploration, the diagram is built from the applied segments together, and segment values appear in a breakdown when you click a node. If you want two clean trees to compare, the most reliable method is to use one tab per segment. Duplicate the tab, replace the segment, and keep the starting point the same.
Compare shares, not raw counts
Mobile and desktop groups rarely have the same size. If mobile has 8,000 sessions and desktop has 2,000, every mobile node will look bigger. Compare each next step as a share of its parent node.
Take a worked example. The starting point is the event view_item.
| Next step after `view_item` | Mobile sessions | Mobile share | Desktop sessions | Desktop share |
|---|---|---|---|---|
| `view_item_list` | 3,200 | 40% | 600 | 30% |
| `add_to_cart` | 800 | 10% | 500 | 25% |
| `scroll` | 2,400 | 30% | 500 | 25% |
| (exit) | 1,600 | 20% | 400 | 20% |
| Total | 8,000 | 100% | 2,000 | 100% |
Raw counts say mobile has more add_to_cart events (800 against 500). The shares say the opposite. Only 10% of mobile sessions go to the cart next, against 25% on desktop. That is the finding. Mobile users go back to the list far more often, so you might next investigate the product page layout on small screens.
Interpreting segment differences
A difference between two segments is a lead, not a verdict. Keep these points in mind.
- Segments overlap. A user can use both a phone and a laptop. A user segment for mobile and one for desktop can both contain the same person.
- Small groups are noisy. A node with 40 sessions can swing by ten points from a handful of users. Treat small nodes with caution.
- Segments do not explain causes. A path shows what happened, not why. Use it to pick what to test or investigate.
- The segment may be what you are measuring. If your segment is "users who purchased" and you look at paths before purchase, you are looking at survivors. Users who dropped off are not in the diagram, so the paths look more successful than the real population.
Common errors
| Symptom | Likely cause | Fix |
|---|---|---|
| The diagram is unchanged after adding a segment | The segment was imported but not placed in Segment comparisons | Drag it into the box in Tab Settings |
| A segment returns almost no data | A sequence with a narrow time window, or a condition on a dimension not collected | Loosen the window and check the dimension in a standard report |
| Every path ends in the target event | A user segment built on that event, so only converting users appear | Use a session segment or compare against a non-converting segment |
| Paths contain steps that never happen consecutively on the site | An event segment removed the events between them | Use a user or session segment instead |
| Segment is missing from the list | It belongs to another exploration or property | Re-create it or share it from the original exploration |
A practical workflow
- Write the question first, for example "Do new users find the pricing page as often as returning users?"
- Choose the starting point or ending point that matches the question.
- Create two session segments, or user segments if the question is about the person, such as
User: newandUser: returning. - Build one tab per segment with identical settings.
- Compare each next step as a share of its parent node.
- Check the size of the nodes you are about to report on.
- Write your conclusion as a hypothesis, then test it with a report, an experiment or the BigQuery export.
Exercise
You apply a user segment "Users who purchased" to a backward path whose ending point is purchase. A colleague says every path shown must be a path that led to a purchase. Is that right, and what would you change to get that view?
Show answer
Not quite. A user segment keeps all events from users who purchased at any time in the date range, including sessions in which they did not buy. The paths can therefore come from non-purchasing sessions of purchasers. To look only at sessions that included a purchase, use a session segment with the condition "event name exactly matches purchase". Because the ending point is already purchase, the backward path is anchored on that event in either case, but the session segment keeps the surrounding sessions consistent when you compare it with a non-purchasing segment.
Exercise
Mobile has 800 add_to_cart events after view_item out of 8,000 mobile sessions. Desktop has 500 out of 2,000. Which group is more likely to add to cart next, and why is the raw count misleading?
Show answer
Desktop is more likely. Its share is 500 / 2,000 = 25%, against 800 / 8,000 = 10% on mobile. The raw count favors mobile only because the mobile group is four times larger, so you should compare shares of the parent node.