Building smart segments can sometimes be difficult, especially as rules start to pile on top of one another. This article will show you how to organize your large segments so they are easy to read, understand, and edit. We will also show how to use smaller segments as "building blocks" to make large segments compact and easy to read.
How To Structure Large Segments
When building large segments you'll find them easy to organize using three groupings.
You'll want one "AND" grouping which contains both an "AND" and an "OR" grouping. They should look like this:
1 - AND - this holds your entire segment
The first grouping in your large segment will be an "AND" grouping. Other than the groupings shown in the picture above, nothing should be added to your largest "AND" grouping.
2 - AND - this holds your segment requirements
The second "AND" grouping allows us to organize the rules which should apply to ALL users in the segment. This is where you'll want to put global rules like "is subscribed to email" or basic segment requirements like "has a purchase" or "is male".
3 - OR - this holds your segment's optional rules
The "OR" grouping allows us to define the optional rules to allow users into our segment. This is where we can outline the rules which allow a user to qualify, but are not must-have rules. OR groupings are great for building a segment such as "user has at least 3 orders, OR has a lifetime spend over $500".
To think about which rules go into the "OR" grouping, ask the following question: If the user doesn't pass the rule defined in the "AND" grouping, is there another way I'd want them to qualify for the email?
If the answer to the question above is "Yes" then the rule defining the additional qualification should go in the "OR" grouping.
How To Use Segments in Segments
One of the filter features available is "Users in segment" which allows you to nest large sets of rules defined in an existing segment into a segment you are building. This way, you can easily repeat sets of rules across segments, instead of re-creating them every time.
The filter feature looks like this:
This feature is also useful for excluding a group of users who meet a specific set of rules, or users who are not in a specific uploaded list. To exclude users, set the final value for "users in segment" to "false".
Example 1: Building a Large Segment
In our example, we are going to build a segment which meets the following rules:
Users in the EU and wholesale users must be excluded; users must be engaged with email, recent signups, or recent purchasers; and only users who are subscribed to email.
Dividing the rules
In our example we have three rules which must apply to all users, and three optional rules.
- Requirements: All users must be subscribed to email, must not be from the EU, and must not be wholesale.
- Options: The users should be recent signups, recently engaged with email, or recent purchasers.
In order to set the Wholesale users exclusion requirement, we need to know how wholesale users are defined in our account. Wholesale users are either in a specific uploaded list, or they have registration source of "wholesale".
In this example, let's image that Wholesale users are in their own list. Therefore, we can build a segment that is filtered by Wholesale users only, and then exclude those users in the segment we're building by using the rules "users in segment" filter feature.
Because this is a requirement, we will add it to the "AND" section.
Filling In The Segment
Starting with the rules we need in the "AND" grouping, we fill in the top half of our segment. In addition to the Wholesale users setting, we set the filter "Is Subscribed to Email" to "true", and we set the filter "Country" to "is not any of" and then listed countries in the EU.
In the "OR" grouping, we defined our optional rules. We defined "recent email engagement", "recent orders", and "recent signups".
Zooming out, we can see the final segment is neatly organized and easy to read:
Example 2: Reducing even further
Is it possible to make the segment above more condensed?
Yes! Using segments in segments, we can make it smaller. We can build two new segments: one that combines the criteria defined in the first "AND" grouping to make a "Not Wholesale and Not EU" segment, and another that combines the criteria defined in our "OR" grouping to make an "engagement criteria" segment.
Example segment: Not Wholesale and Not EU
Example segment: Engagement Criteria
Then, using the "Users In Segment" feature, we can filter by users defined in each of the segments shown above to create a more condensed segment that is easier to understand:
Special Case: Seed Lists
To include a seed list you'll need to use an "or" condition which sits outside the other conditions for your users. See this example which blends a seed list of users with one half of an A/B test: