Analytics Rockstar Blog

Segmenting Dimensional Value Counts

Eric Matisoff
Eric Matisoff

We've been getting this question for years: how can I create a segment of users who have visited a specific page N times. For example: I want to analyze people who have visited this product category page 4 times. Let's dissect how this needs to be done in Adobe Analytics and Customer Journey Analytics.

Apologies in advance for the length of this post, but hey - you're gonna learn something so don't blame me!


Building a Segment to Analyze Dimensional Value Counts

Sequential Segmentation is one of the most powerful capabilities in Adobe's analytics tools. Analysts have so much control to refine their analyses to exactly the right hits, visits, visitors, and people. When thinking about answering the question "How can I build a segment of people who saw the homepage exactly 2 times", Sequential Segmentation is right at the top of the list for answering it. But you have to be careful when building the Segment, you need to make sure the segment:

  1. Ensures people viewed the page twice
    AND
  2. Excludes people who have viewed the page more than twice

I've put together a screenshot of how I built this Segment in Customer Journey Analytics for our Adobe Store website, but it'd work exactly the same in Adobe Analytics as well.

Powerful Adobe Analytics Segment for Dimensional Value Counts
It's a beaut, Clark! 🎄

Let's break down each of the components of the Segment.

First of all, the Segment is People-based. This is because I want my Segment to include all actions from People who have viewed the homepage twice. Technically, if I wanted to, I could change this to Visit or Session, and see all actions from Sessions where the homepage was viewed twice.

Person containers ensure that every event associated with People who satisfy the requirements will be included.
Person containers ensure that every event associated with People who satisfy the requirements will be included.

Next, we want to add a container, and have the contents of that container focus on People who viewed the homepage, then viewed it again (eventually). This is where we'll first dabble in Sequential Segmentation. You'll notice that this container is also people-based, because I want to include views of the homepage during any time in the visitor's history.

Sequential Segments mean you've switched the operator from AND/OR to THEN
Sequential Segments mean you've switched the operator from AND/OR to THEN

A lot of analysts might stop here. And the thinking is sound: this Segment focuses on people who have viewed the homepage twice.
HOWEVER WE CAN'T STOP WON'T STOP. Why?

Because this includes people who have viewed the homepage three or more times, that's why!

So we also need to exclude People who have viewed the page more than twice. Let's add a second People-based container with an And between them, and in this container, we put another sequence of viewed homepage three times in a row. Finally, we'll Exclude this container sequence (this is key) so we exclude people who have viewed the homepage thrice.

You can find the Exclude button for Segment Containers by clicking that Gear in the top-right.
You can find the Exclude button for Segment Containers by clicking that Gear in the top-right.

And... voila! We've now got the Sequential Segment of our dreams!

Like all complicated Segments, let's test it to ensure it does what we expect:

When I apply my Segment at the top, you can see how my Fallout shows that 100% of the people in the Segment viewed the Homepage twice, but not thrice. In addition, other page views on the site are included since this is a People-based Segment.
When I apply my Segment at the top, you can see how my Fallout shows that 100% of the people in the Segment viewed the Homepage twice, but not thrice. In addition, other page views on the site are included since this is a People-based Segment.

If you wanted to compare People who have viewed a specific page (or page type or whatever, any dimension can work here) two times to those that have viewed it three times, you'd have to repeat this process for each slice of data. And that can take a while to do. But well worth it!

An option for simplifying using Customer Journey Analytics

So although this isn't too painful of a process, I'm always thinking: "How can we simplify things using CJA?"

Well, we have our good friend the Data View to help us out. In a Data View, Dimension Components can be changed to Metrics (and vice versa), and that's exactly what we need to do to simplify things for this use case: I want to have a Metric of Home Page Views and then create a People-based Segment where Home Page Views = 2.

Let's give it a try:

First step: Create a Metric of Home Page Views

I'm going to edit my Data View, then find my Page URL dimension, and mash that Duplicate button:

Page URL found and Duplicated
Page URL found and Duplicated

Next, I'll change my Component Type from a Dimension to a Metric. Without making any other changes, this simply becomes a count of instances of the Page URL Dimension.


Is it Magic, or is it Adobe Customer Journey Analytics?
Is it Magic, or is it CJA?

Finally, I want to filter my new Metric to just the Homepage. There are plenty of other options to consider when doing this, but for our needs, it's just a simple Include/Exclude Values filter.


Filtering to just my Home Page, your URL will almost definitely be different.
Filtering to just my Home Page, your URL will almost definitely be different.

Finally, I'll give it a friendly name, and head back to my Project. I can now confirm that I've set it correctly by pulling the new Metric into a Freeform Table with Page URL as my Dimension.


Ooooh - that's a bingo!
Ooooh - that's a bingo!

Now that I've got a Metric in my Data View, I can easily pull it into a People-based Segment in CJA (OK technically it's called a Filter) and limit the Metric to exactly two Home Page Views.


Dimensions become Metrics to allow for Filtering and Numerical Operators? That's a yes from me, dawg
Dimensions become Metrics to allow for Filtering and Numerical Operators? That's a yes from me, dawg

And that's all there is to it! Just like in our previous example, we'll want to confirm the Segment was created correctly. In fact, this is something you should ALWAYS DO WHEN YOU CREATE A SEGMENT: confirm it does what you think it does.


[insert chef's kiss emoji here]
[insert chef's kiss emoji here]

Vundebar! See how that's simpler than the sequential segment from earlier? The number one reason is I can easily create other Segments that focus on seeing the Home Page three times, or four times, or five ... So many fewer clicks than dragging and dropping the URL as a Sequence twice per count.


Go segment those dimensional value counts, you Rockstar you!


More Stories

Debugging Failed Dataset Records in Experience Platform

Oh no! There's a Failed Record in your Experience Platform Dataset because something didn't pass Validation! Find out how to debug and resolve these errors by accessing the full XDM Object in those records.

Eric Matisoff
Eric Matisoff

The Basics of Marketing Tracking Parameters

Tying advertising efforts to behavior is a fundamental requirement for digital analysts. Let's spend some time digging into how Marketing Channels are set, based on tracking/query string parameters, referrals, and more.

Eric Matisoff
Eric Matisoff