AND and OR connectors are critical to setting up segments and flows in Klaviyo. They define who will be grouped within your segments as well as when someone will receive flow messages. In this guide, we will go over what differentiates the two conditions and when to use each to target the right audience.
Don’t have time to read? Check out the AND vs. OR graphic for guidance.
Using the AND connector between conditions will make a segment or flow filter more exclusive. Klaviyo checks each condition separated by AND individually; therefore, each condition must be true in order for someone to be included. So, if a customer meets one condition but does not meet the other, they will be excluded from your flow or segment.
In the example flow below, someone must be part of your VIP segment AND have opened an email in the last 30 days to be included. If someone is only part of your VIP segment— or has only opened an email in the last 30 days— they will not go through this flow when they place an order. They must have done both to qualify.
In the example segment below, the customer must have subscribed to your newsletter AND placed an order at least once over all time. If someone has done only one of these actions, they will not be included in your segment. Only those who have done both actions will appear within this segment.
Using the OR connector between a sequence of segment or flow conditions will make them more inclusive. Because of the OR connector’s inclusivity, someone only has to meet one of the joined conditions in order to be added. So, if a customer meets one condition but does not meet the other, they will still be included in your flow or segment.
In the example flow below, we set a Winback flow to exclude anyone who has Placed an Order since starting this flow OR has been active on your site in the last 20. This way, anyone who has been active on your site recently (or who has placed an order) will not receive the Winback flow. Thanks to the inclusivity of the OR connector, they only need to do one or the other.
In the example below, the customer must have subscribed to your Newsletter list OR ordered a product at least once over all time. If someone has done neither or only one of these actions, they will not be included in your segment. However, anyone who has done at least one of the actions will appear in this segment.
AND vs OR Graphic
When it comes to negative statements, remember that AND requires every condition to evaluate as true, whereas with OR, only one must be true.
For instance, if you want to create a flow filter that excludes those who live in the USA and Canada, you may think you would use Properties about someone and say Country doesn’t equal USA OR Country doesn’t equal Canada. However, the OR connector means that someone can live in Canada (and not the United States) and still go through this flow, since only one of these conditions must be true. To exclude people in both countries, use the AND joiner.
In some cases, you will need to apply both AND and OR conditions when generating a segment or flow. The rules around the conditions do not change, so when two conditions are joined by AND they both must be true for subscribers to be included; whereas when conditions are separated by OR, either one can be true for subscribers to be included.
For example, in a Nearly There segment, your goal is to find subscribers who are engaged but have not yet purchased from your store. This indicates who may need an extra incentive or reminder of why they should buy. Engagement is defined with both AND and OR conditions as shown below.
In this case, the OR connector acts as if it’s contained within parentheses. It is sandwiched between two AND connectors, but since the opened and clicked email conditions are separated by OR, they do not both need to be true for someone to appear within the segment.