Segments, rules, conditions
A segment identifies a set of contacts within the platform that meet specific conditions and can change over time.
Segments are built by applying one or more user-defined rules to a specific data set.
Each rule consists of a selection of conditions that interact according to logical operators, also known as interaction conditions, applied to a specific data category.
It is possible to combine two or more rules and modify their order at any time, thereby changing the composition of the segment.
Some conditions are automatically displayed and depend on the settings defined on the database being used.
Logical operators
Operators are elements that relate:
- rules when creating a new segment;
- existing segments when creating a new combined segment;
- conditions when creating a new rule.
Operators for rules when creating new segments
There are 3 operators available when creating a new segment and/or combined segment:
- AND: The result is the set of contacts that match both the first and the second rule.
- OR: The result is the set of contacts that match either the first or the second rule.
- EXCEPT: The result is the set of contacts selected by the first rule but not by the second.
Below is a detailed explanation with concrete examples:
AND
The AND operator relates two rules (or existing segments) so that both the first and the second are considered simultaneously. In set theory, this corresponds to the intersection.
Example
On the platform, if you relate “Women” AND “Purchases in the Last Year”, the result would be: “Women who made a purchase in the last year”.
OR
The OR operator relates two rules (or existing segments) by considering the first rule and adding all those who satisfy the second rule. Obviously, those in both are counted only once. In set theory, this corresponds to the union.
Example
On the platform, if you relate “Women” OR “Purchases in the Last Year”, the result would be: “Both Women and those who made a purchase in the last year”.
EXCEPT
The EXCEPT operator relates two rules (or existing segments) by considering the portion of users present in the first rule and removing from this group those who are also in the second rule. In set theory, this corresponds to the difference A-B for the non-intersecting part.
Example
On the platform, if you relate “Women” EXCEPT “Purchases in the Last Year”, the result would be: “Women who did not make a purchase in the last year”.
What happens if more than 2 rules exist?
When more than two rules are used to define a segment, the system applies the interaction conditions sequentially. The platform calculates the result of combining the first and second rules. The result is then combined with the third rule, based on the interaction condition between the second and third rules, and so on.
It is therefore very important to consider the order in which rules are created when there are more than 2, especially when using different operators to relate them.
This means that in the case of A OR B AND C, A OR B will be evaluated first, and the result will then be related to C.
So the order will be:
- The operation between the first 2 rules (A OR B) is executed, resulting in a result, let's call it D:
- A OR B = D
- The result D is then related to the next rule (C):
- D AND C
Example
On the platform, if you want to select “Both Women and those who made a purchase in the last year and have given marketing consent”, he should set the rule as follows:
Where the schema will be:
“Women” OR “Purchases in the Last Year” AND “Marketing Consent”
Executed in the following order:
- “Women” OR “Purchases in the Last Year” = “Both Women and those who made a purchase in the last year”
- And as a second step:
“Both Women and those who made a purchase in the last year” AND "Marketing Consent".
Any changes to the order will lead to different and potentially incorrect results.
For instance, changing the order to:
“Women” AND “Marketing Consent” OR “Purchases in the Last Year”
Where the schema will be executed in the following order:
- “Women” AND “Consented Users” = “Women who have given consent”
- And as a second step:
“Women who have given consent” OR “Purchases in the Last Year” = “Both consented Women and those who made a purchase in the last year”
Thus, changing the order of the rules changes the result, potentially leading to issues, as in this case where “those who made a purchase in the last year” also includes users who have not given consent.
Operators for Conditions When Creating a New Rule
When creating a new condition, the primary operators are:
- ALL: Selects only the contacts that meet all the conditions defined in the rules. The result is similar to applying a logical AND operator.
- ANY: Selects all contacts that meet at least one of the conditions defined in the rule. The result is similar to applying a logical OR operator.
Handling date fields
Among the available field types, there are 2 date-related types:
- Date: Format yyyy-MM-dd (year-month-day)
- Date time: Format yyyy-MM-dd hh:mm (year-month-day hour:minute)
All operators behave identically with both formats.
Managing date conditions
Date management can be absolute, by setting specific values to be evaluated, or relative to the time of evaluation of the segment (when it is being viewed or when it will be used in scheduling).
Absolute or specific date management is the default and is shown as follows:
It is possible to set the date to be managed in the selection.
By clicking on the double arrow icon, you can switch to relative date management.
This will allow the date to be evaluated according to when it will be used/valued.
Today corresponds to 0 relative to the evaluation time.
The day before the evaluation time is -1, the next day is +1. Similarly, monthly, weekly and yearly intervals can be set.
How operators work
Operators determine the type of operation to perform with the set dates and are located just below the name of the field in question.
Their meanings are as follows:
- Equal to: The set date must exactly match the evaluation time.
- Not equal to: The set date must differ completely from the evaluation time.
- Between: The evaluation date must be greater than the first set value and less than the second.
- Equal to or greater than: The set date must exactly match the evaluation time or be greater.
- Greater than: The set date must be greater than the evaluation time.
- Equal to or less than: The set date must exactly match the evaluation time or be less.
- Less than: The set date must be less than the evaluation time.
These operators refer to the date including hours and minutes, so there is often no exact match if evaluating daily periods.
For example, if a condition is set as follows:
- Subscription date “Equal to” 30/06/2024 00:00
it does not consider all subscription values with times different from 00:00 but within the same day (30/06/2024).
For this reason, there are additional specific operators:
- IS_DATE_EQUALS: The set date must exactly match the evaluation time considering only yyyy-MM-dd (year-month-day).
- IS_DAY_EQUALS: The set date must exactly match the evaluation time considering only the day value (e.g., 25 if the date is 25/06/2024, this applies also to other dates like 25/08/2019).
- IS_MONTH_EQUALS: The set date must exactly match the evaluation time considering only the month value (e.g., 03 if the date is 25/03/2024, this applies also to other dates like 19/03/2019).
- IS_YEAR_EQUALS: The set date must exactly match the evaluation time considering only the year value (e.g., 2024 if the date is 25/03/2024, this applies also to other dates like 19/08/2024).