Understanding Advanced Segmentation Logic

Advanced segments take our basic audience segments to the next level with nested conditions that combine any and all logic. These advanced segments are super flexible and customizable, so it might take some time to master their logic and filtering settings.

In this article, you'll learn about the logic that powers advanced segments.

Things to Know

Here are some things to know before we get into the logic of Advanced Segmentation.

About the Logic

All segmentation in Mailchimp uses any or all logic that applies to the conditions underneath it. This means you can create a segment of contacts who meet any of your individual conditions, or all of them together.

TermMeaningExample
anyThis logic tells our system to show you contacts who meet one or more of your conditions.Any contacts from either Boston or Chicago.
allThis logic tells our system to show you contacts who meet all of your conditions.All contacts who opened your last campaign and made a purchase in your store.

Basic segments are limited to one type of logical relationship, but advanced segments can support both any and all logic together in one segment. This is because they contain groups of conditions that each use their own any or all logic. Think of an advanced segment as combining several basic segments into one.

Example

Let’s say you wanted to view all of the subscribed contacts who opened your last email campaign and are either tagged Atlanta or have an address that contains Atlanta.

To do this, you’ll use all for the the top-level logic. Then, you’ll choose Open Activity as your first condition and set the timeframe and campaign as needed. Next, you’ll add a condition group that uses any logic, then add the appropriate Tags and Address conditions to the group.

It should look something like this.

audience-advancedsegment-example-openedatlanta

For step-by-step instructions on how to create an advanced segment, check out Create an Advanced Segment.

Applying the Logic

It's important to think through the logic you plan to use when you build your advanced segment. If you take the time to set up your segment correctly and as efficiently as possible, it’ll be easier to manage and take less time to generate.

To determine the right logic and conditions, it can be helpful to write a sentence that represents your segment. After you've defined the relationship between the conditions, and the goal of each, you'll be able to choose your segmentation options easily.

When to Use Any

Use any for the top-level logic in your segment when you want to find contacts who fulfill one or more of your conditions or groups of conditions.

Example: Find any subscribed contact who is either a faculty member or a new student.

audience-advancedsegment-anylogic-example

This segment includes Subscribed contacts only, uses any logic at the top level, and has one stand-alone condition and one group of conditions. The first condition looks for contacts whose role is faculty. The condition group uses all logic and looks for contacts whose role is student and who were added within the past 30 days.

When to Use All

Use all as your top-level logic to find contacts who meet all of your conditions and condition groups.

Example: Find all students and faculty who are either engaged subscribers or made an e-commerce purchase.

An example of an advanced segment with the top-level logic set to all.

This segment includes Subscribed contacts only, uses all logic at the top level, and has one stand-alone condition and one group of conditions. The first condition looks for contacts whose role is either Student or Faculty. The condition group uses any logic and looks for subscribed contacts who either have a high member rating or made an e-commerce purchase.

When to Simplify Your Logic

If your advanced segment is very complex, you might be able simplify your logic so it will generate faster and more efficiently.

Advanced segments use a variety of operators that can look for one, all, or none of a variable, so consider whether a different operator might streamline your conditions. Familiarize yourself with our available segmenting options, so you can make the most of your conditions and condition groups.

Example: Find any subscribed contacts who are alumni, or students and faculty members who received the previous campaign but didn't open it.

audience-advancedsegment-badexample

This version of the segment uses separate groups of conditions to target faculty who have not opened the previous campaign and students who have not opened the previous campaign.

This returns the contacts we want, but we could accomplish the same thing with fewer conditions. Let's simplify it to just one stand-alone condition and one group of conditions.

To do this, we'll choose Subscribed contacts and set the top-level logic to any. Then, we’ll choose Role > is > Alumni for the first condition. In the group of conditions, we'll use all logic and look for Role > is > Student or Faculty along with the Sent Activity and Open Activity conditions.

audience-advancedsegment-example-lesscomplex

This version of the segment avoids repeating unnecessary queries, which should reduce the amount of time it takes for the segment to generate.

About Operators and Empty Fields

When you create advanced segments, you’ll use operators to exclude or include contacts based on a certain value in an audience field. Different types of operators vary in the way they handle empty audience fields.

For example, if you wanted to create an advanced segment of contacts whose address does not contain "Atlanta,” the system will return contacts who have a value other than Atlanta in the address field, and would also return contacts with an empty address field.

This chart shows which segment operators will include or exclude contacts with empty values in relevant fields.

OperatorWill Segment Include Blank Values?
isno
is notyes
containsno
does not containyes
starts withno
ends withno
greater thanno
less thanno
is blankyes
is not blankno

Was this article helpful?

Anything else we can do to improve our site?