How Google Analytics Sequence & Conditional Segments Actually Work…


Have you used the Google Analytics sequence or conditional segmenting before and seen the data look very strange? Today we’re going to cover a few examples and reasons we’ve seen cause these issues.

First, to truly understand the power of advanced segmenting in Google Analytics we need to understand the difference between user, session, and hit level scoping.

  • User scoping – Persists across the users time frame in which your date range exists.
  • Session scoping – Persists across the session that something is declared within.
  • Hit scoping – Persists for the single “hit” that the attributes were sent in only.

How Do Sequence Segments work?

Sequence start: “any user interaction” vs “first user interaction”

It is important to note that as with other Google Analytics segment types, your defined attributes are only matching to sessions and user attributes within your specified date range. This means that if your date range is set to January 1 – January 10, Google Analytics will not utilize the users data from December 28th even if it does exist.

When you set this to any user interaction, Google Analytics simply looks at your returned data and if it matches your sequence at any point in the session or users experience it matches.

When you set this to first user interaction, Google Analytics looks at the first hit of information for a given set of sessions or users and see if it matches your defined sequence.

Sequence steps: Immediately followed by vs followed by

Followed by looks to see if at anytime in the session or users experience the had step 2/3/etc after step 1.

Immediately followed by looks to see if step 2/3/etc happened the hit after step 1. It is important to declare as many of the attributes for the given hit to make sure you are getting as much precision as possible.

For example, you want to see sessions with pageview A immediately followed by pageview B. You will see that when you set this segment, and go to user explorer that there are people who are completing events between your pageview A and pageview B. The reasons for this is due to how hits work, every event is tied to a page url.

  • Hit 1: Pageview A
  • Hit 2: Click event, on Pageview A
  • Hit 3: Pageview B

You should never see an event between this sequence that did not happen on pageview A. If you don’t want to see hit 2 in your sequence, you can set event category does not match regex and then do ‘.*’ for wildcard. Take a look at scenario 4’s screenshots below.

How Do Conditional Segments Work?

Conditional segments let you set required attributes of a session. You can also layer these on top of other session requirements or sequences as we do in scenario 2 below.

Now let’s go through some scenarios to show how advanced segments work…

Google Analytics Advanced Segmenting Scenarios

Scenario 1:  Show me users whose first interaction in my timeframe is a pageview on the home page, with the pageview after being the search results page.

You can see we’re using sequence segments here. I have done this because it enables the analyst to flip between users and sessions.

It also allows you to set your step 1 to either be the “first user interaction” for your user (in the selected date range), or the start of any sequence, where it did not necessary have to be the first thing in the user or session experience.

Scenario 2Show me Google / Organic sessions that pogo stick from a specific product page to the shopping cart, back to the specific product page, then purchase.

Part 1: Build the desired interaction sequence

In part 1, we focus on building the interaction sequence for the session. Notice that our sequence start is set to “any user interaction” because we don’t care that this interaction sequence was done starting from interaction 1, we just care that the session had it happen at all.

You can see that we have some values set in the “sequences” tab denoted by the “1” in grey on the life sidebar of the screenshot. You can also see we have “conditions” applied as noted by the same “1” in the conditions tab. We are combining these two segmenting capabilities to really dial in our cohort.

Part 2: Exclude sessions that don’t have a source / medium of Google / Organic

In part 2, you can see we are excluding sessions where the source / medium does not equal “google / organic”. This will combine with the results from Part 1 to give us the cohort that matches our desired scenario. Combing segment filtering types is extremely useful for really locking data down.

Scenario 3: Show me sessions that have a search result pageview, immediately followed by a product thumbnail click event on the search result page, immediately followed by a product pageview.

Immediately you should take note that we’ve setup 3 steps in the below sequence, all with “immediately followed by”.

For step 1) We simply declared the pageview for /search.html

For step 2) Since we’re looking for a match on product thumbnail clicks specifically on the search results page I have explicitly called out the page, event category, event action, and event label dimensions. By grouping these into a single step I am telling Google Analytics that the hit needed to include all of these attributes

For step 3) We simply have our product pageview




Passionate about growth, analytics, and E-commerce. Life is about pushing the envelope.