Skip to content →

Using AND in Google Analytics segments

Segments are an absolute must in GA; if you’re not segmenting your data you’re really not  doing web analytics (well, not properly anyway). Segments are incredibly useful for focusing on sub-groups of users of your site; you can segment on more or less any data GA collects, including custom dimensions and events.

Segmenting based on sequences can be particularly useful (particularly if you wanted to create a ‘real’ funnel, without back-filling). There’s a major limitation with segments that I’m going to discuss in this post; the AND statement in segments based on conditions.

Let’s look at an example of a situation where you might want to use the AND statement, and how it won’t work.

Imagine you want to look at the behaviour of people who spend a relatively long time on a particular page on your site (perhaps it’s a fairly long blog post or discussion of the merits of a product). Let’s say you want to create a segment of users who spend more than 20 minutes on that page. You might be tempted to create a segment using conditions as shown below, using the Porsche 924 buyer’s guide page as an example:

Screen Shot 2016-05-02 at 10.11.28

To most people, I’m willing to bet this looks like it’ll include users who spent more than 20 minutes on the buyer’s guide page. As you might have guessed by this point, this is false. This segment will actually include any users who saw the buyer’s guide page, and who had a time on page of more than 20 minutes on ANY page. To prove this, let’s create a segment that includes the 2 conditions as separate conditions, like this:

Screen Shot 2016-05-02 at 10.12.14

When we look at the average time on the buyer’s guide page for these segments, it shows they work in exactly the same way, and that the AND statement doesn’t work as you might expect. The average time on page is longer for these segments than for all users, but this is probably because those spending more than 20 minutes on any page are likely to be more engaged than others.

Screen Shot 2016-05-02 at 10.13.01

In this example, there’s really nothing you can do to look at this segment, other than using my colleague Ed Guccione’s method of getting actual time on page per users, but that’s fairly time-consuming and complex, and you won’t be able to explore it through the UI.

So when using segments be wary of this trap; the ‘AND’, doesn’t link 2 statements together as you might expect. In the time on page example it’s pretty easy to spot it doesn’t work as you’d expect, but there are other ways where it might not be so obvious the data/evidence/insight you’re getting is actually garbage. It’s always a good idea to verify your segments by running the dimensions and metrics you’ve based them on to check you’re not including people or sessions you wanted to exclude.

So why does GA have this function? I think it’s designed to allow you to group conditions together; for example, you might be interested in people who spent more than 20 minutes on any page, and saw the Porsche buyer’s guide, but didn’t see the Mercedes W123 buyer’s guide. You could put any include filters in the same group, and all the excludes in another. This still doesn’t do anything different from having each filter separately, but might look neater. If you can think of another reason or use for this function, let us know in the comments box.

(Visited 179 times, 1 visits today)

Published in Google Analytics Segmentation


Leave a Reply

Your email address will not be published. Required fields are marked *