Skip to main content

How to force a hit-level segment in Universal Analytics

Dara Fitzgerald15 February 20224 min read
How to force a hit-level segment in Universal Analytics
Note: This how-to is for forcing a hit-level condition within a session-level segment. It is not commonly understood that if two criteria in a user-level segment are in the same condition filter, then they have to occur in the same hit. This can be achieved within a user-level segment, with the default behaviour of adding multiple criteria within a single condition, separated by AND statements.

Doing this with user-level segments, however, will include sessions for those users where they did not meet your criteria. As a result, it’s often necessary to do this within a session-level segment, and it is that requirement that is covered in this guide.

Typically, within session-level segments, the criteria you want to base your segment on can happen independently within the session. So, for example, you might want to look at sessions where the landing page was the homepage and the session resulted in a transaction. These two criteria are independent of each other i.e. they happen at different points in the session. Therefore, you can do this by simply adding additional conditions to the segment and this will give you exactly what you want.

Sequence-based segments

However, there are times when you need to be more specific and tie two criteria together within a single hit. The most common example of this is when you want to include sessions that involved the purchase of a specific product i.e. you want to tie a product name to a purchase hit. This sounds like it should be easy to do and it’s a common requirement, but Google Analytics only offers session-level and user-level segmentation, and what we need here is actually a hit-level condition, as we want to specify a product that was contained within a purchase hit.

The problem with trying to do this within the segment builder for a session-level segment is that it will only look to see if each of the criteria happened at some point within the session, and each criterion is looked at independently. So, if we tried to do this…

…it would show us this:

Which looks sensible, however, it is very misleading. This will include sessions where a product name exactly matching “Delon Velvet Chair” was included in a hit and in the same session, the unique purchases per hit is greater > 0. However, what it does not specify is that the hit the product name appeared in was the same hit as the purchase occurred. So, it’s entirely possible that this session involved the user viewing the “Delon Velvet Chair” product page (or that product appearing in a product list they viewed), but purchasing an entirely different product.

Session-level segment criteria

To ensure that we only include sessions where the Delon Velvet Chair was purchased, we need to force the segment to tie the product name criteria to the unique purchase criteria in the same hit. This is where the hack comes into play.

In the segment above, we are using a sequential condition, and this is the hack. Sequential segments evaluate each ‘step’ as a single hit, so this sequential segment is the equivalent of a hit-level segment.

Below are the results of the two segments we have created: the incorrect condition-based segment and the correct sequential segment.

As mentioned, the incorrect condition-based segment is over-including, as it will include sessions where the product name appeared in a hit that was separate from the purchasing hit. However, the sequential segment forces the condition to be hit-level and therefore this will only include sessions where the product name (in this case, “Delon Velvet Chair”) was in the same hit that the purchase occurred (unique purchases per hit > 0).

Prerequisites

  • The interactions you wish to include in your segment are already being tracked in Google Analytics.
  • Enhanced Ecommerce is being used if wanted to segment by product(s).

Use cases

  • Segmenting purchases of a specific product (or products) within a single transaction.
  • Seeing combinations of events triggered on specific pages.

Suggested content

Measurelab awarded Google Cloud Marketing Analytics Specialisation

At the start of the year, if you’d asked us whether Measurelab would be standing shoulder to shoulder with Europe’s biggest consultancies by September, we would've been surprised. Not because we don't believe in ourselves, but because these things feel so distant - until suddenly, they’re not. So, here it is: we’ve been awarded the Marketing Analytics Services Partner Specialisation in Google Cloud Partner Advantage. What’s the big deal? In Google’s own words (with the obligatory Zs): “Spec

Will Hayes11 Sept 2025

BigQuery AI.GENERATE tutorial: turn SQL queries into AI-powered insights

BigQuery just got a major upgrade, you can now plug directly into Vertex AI using the new AI.GENERATE function. Translation: your analytics data and generative AI are now best friends, and they’re hanging out right inside SQL. That opens up a whole world of new analysis options for GA4 data, but it also raises some questions: * How do you actually set it up? * What’s it good for (and when should you avoid it)? * Why would you batch the query? Let’s walk through it step by step. Step 1: H

Katie Kaczmarek3 Sept 2025

How to start forecasting in BigQuery with zero training

If you’d told me five years ago that I’d be forecasting product demand using a model trained on 100 billion time points… without writing a single line of ML code… I probably would’ve asked how many coffees you’d had that day ☕️ But its a brand new world. And it’s possible. Let me explain What is TimesFM? TimesFM is a new foundation model from Google, built specifically for time-series forecasting. Think of it like GPT for time, instead of predicting the next word in a sentence, it predicts t

Katie Kaczmarek14 Jul 2025