Solved

Create segments using custom properties with AND-OR logic

  • 30 January 2024
  • 5 replies
  • 61 views

Badge

Hello Klaviyo community,

I would like to create segments based on custom properties as follows:

(property1 = “AAA” AND property2 = “BBB”) OR (property3 = “CCC” AND property4 = “DDD”)

It seems that this is not possible in Klaviyo. 

Am I missing something? Is there any workaround to achieve what I need?

Thank you very much in advance! 

 

icon

Best answer by JessFosnough 30 January 2024, 19:08

View original

5 replies

Userlevel 6
Badge +29

Hi @ageorgiev 

Thank you for posting your question in the community. The ability to create these segments is possible, but it all depends on how the data is coming into Klaviyo. Pending on the data type you may need to switch the data type in the segment builder.

See if that gives you the logic you are looking for.

@In the Inbox 

Userlevel 5
Badge +17

Hi @ageorgiev,

If I’m reading your question correctly, you’re wanting to have inner joins using AND, plus an outer join using OR.


I will admit that I’m not an expert when it comes to logic like this, but in my experience with Klaviyo, you can only use AND as an outer join, and can only use OR as an inner join. The workaround I came up with is to create 2 segments, then send your campain to both of them.


Segment 1: Property 1 = “AAA” AND Property 2 = “BBB”
Segment 2: Property 3 = “CCC” AND Property 4 = “DDD”


If you’re concerned about overlapping customers, you can send segment 1 first, then send segment 2 and exclude anyone who is also in segment 1.

Perhaps I am wrong and someone else can tell you how to set up the logic; if not, then I hope this information is helpful. Best of luck!

Jess

Badge

Hi @JessFosnough,

Yes, I can create two segments but this means I have to duplicate all further settings based on these segments. For example, if I want to create a flow for the profiles that match the desired condition (using trigger “Added to segment”) I would need to create two segments, two flows and duplicate all steps and branching in both flows. This seems very odd and error-prone to me.

Userlevel 4
Badge +23

While I believe is @JessFosnough is correct, let me loop in @ebusiness pros for some additional insight here. She’s a segmentation queen 👑

Userlevel 6
Badge +24

Hi @ageorgiev! This is an interesting challenge you’ve run into - thanks @kaila.lawrence for the tag. 

 

First, @JessFosnough is correctly identifying the current limitation of Klaviyo’s segment builder. When setting up segment conditions, the only option right now is to use AND as an outer join, and OR as an inner join.

 

So here’s a quick confirmation of how you’d make this work for campaign sending.

As @JessFosnough pointed out, you’ll need two segments to grab each custom property pair.

IF you’re wanting to target both groups of people for one campaign, your recipients would look like [Include Segment 1: Property 1 = “AAA” AND Property 2 = “BBB” AND Segment 2: Property 3 = “CCC” AND Property 4 = “DDD” ]

 

Then there’d likely be scenarios where you’d send a campaign to only Segment 1 and EXCLUDE Segment 2 from the recipients, or vice versa.

 

For flows, here’s how to make it most efficient and prevent logic errors.

 

If we zoom out a little, that might help you find the best solution for what you’re trying to build in Klaviyo... If you’re willing to share more info about what types of properties you’re creating, and what your intended values are, I’m happy to give you more specific recommendations!

 

Generally, I agree with your desire to minimize flow triggers and conditional splits that feel like duplicates of another flow. So how can we best help you simplify the plans for your flow logic, and make it the most functional iteration possible?

 

For example, if Property 1 and Property 2 correspond to a product interest, is there a way to combine those into a broader category? AND is there existing product data from Shopify (or your ecom platform if not Shopify) that can be leveraged and remove the need for so many custom properties?

 

Then, after we consider that, maybe there’s a way to apply a similar consolidation to people with Property 3 and Property 4 on their profile…

 

I’ll keep an eye out for more details from you!

 

Warmly,

Gabrielle

 

 

 

Reply