Solved

Product variations instead of product items in the flow

  • 23 March 2022
  • 3 replies
  • 851 views

Badge +2

Hey there,

maybe someone can help - as i am trying to solve this issue by myself for several hours.

 

I have a shopify product and 4 different Variations of the product, which don't show up as "items" in klaviyo (obviously as they are no items but variations of the item). So i can not use the Conditional Split to set up different E-Mails in the flow for the customers that bought a different variation of this item (as i can not use the "SKU" in here). The SKU is the only option i see to refer to the different variations of the item in klaviyo - or is there another way? 

The klaviyo support told me to use the conditional block instead and gave me a code (event.extra.line_items.0.sku = "123456") where to put in the SKU to only show specific content of the mail to the customers that bought one of the variations.  So i took one part of the email (text block for example) and implemented the code with the first SKU (see the picture):

I checked the preview with a customer who placed an order with that SKU and it worked.  Then i duplicated the Text block, changed it for the next SKU, switched it "ON" and saved it.

I went to the preview and took a customer who purchased that different item. What happened - the text block didn't show up at all. So obviously it doesn't work the way i want it to. 

Where is the mistake? 

icon

Best answer by Taylor Tarpley 24 March 2022, 22:54

View original

3 replies

Userlevel 7
Badge +60

Hi @NatalieOceanmata

 

Welcome to the Community! We are happy to have you! 

 

Yes, the support team gave a great workaround here to use Show/Hide Blocks Based on Dynamic Variables such as SKU for different item variations. However, it should be noted how List, or Array, data works.  

 

At present, the condition is set up to only look at the first line-item in the array because you kept the .0. part of the code. Essentially this current statement indicates, if the first item in the array is DON-2: show this block. However, I’d recommend using the format “SKU1” in event.extra.line_items for the second variation and then “SKU2" in event.extra.line_items etc. for the third and etc for each block afterward you might need.

 

The first block worked successfully because that SKU happened to be at the top of the list of items ordered. 

 

Thanks for participating in the Community! Hope this helps :)

-Taylor 

Badge +2

Hi @Taylor Tarpley,

 

first of all thank you for your answer to my question.

I tried various codes now but i don’t get it. Can you write down the exact code? 

So the Code for the first item variant would still be: 

event.extra.line_items.0.sku = "DON-1-turtle"

For the next it would be ..?

event.extra.line_items.SKU1.sku = "DON-2-turtle" ? Or “event.extra.line_items.1.sku1 = "DON-2-turtle" ? OR am i totally wrong? 

Sorry for not totally understanding and thank you so much for your help! 

Natalie 

Userlevel 7
Badge +60

Hi @NatalieOceanmata

 

No problem, would love to clarify further!

 

it should be the format: "SKU1" in event.extra.line_items  in one block in the hide/show condition, this will essentially say ‘show this block is this condition is met’. Then in the next, separate block: "SKU2" in event.extra.line_items then in a third block "SKU3" in event.extra.line_items and so on.

 

Alternatively, you could also use the “Ordered Product” metric in the conditional splits in your flow which will allow you to filter by SKU, as items wasn’t a possibility. in case you to forgo using hide/show logic altogether!

 

Hope this helps!

-Taylor 

Reply