Skip to main content

Hello Klaviyo community!

 

I’d like to set up a Flow where an Abandoned Cart trigger happens - but only if the item is actually in stock.

 

Some of my items sell out quickly and my customers get annoyed when they cart an item, have it sold out during checkout, then receive an Abandoned Cart email 3 hours later for an item that is not in stock.

 

Is there a conditional split that will help rectify this?!

Hi  KenH,  Welcome to the community.

 

Alright so you can try this out this;

Make use of STARTED CHECKOUT trigger because it's better than Added to cart 

2. Add delay the time to send email probably 1,2 or 3 hours before sending the email

 

3. Then you can add conditional split although it's depends on your store platform.if you are making use of shopify and have your product catalog properly synced to klaviyo... You can create a split using this condition 

 (> “Items in Checkout” contains an item where “Variant.InventoryQuantity” is greater than 0)


Thanks!

 

I’m unable to locate the Variant.InventoryQuantity or Items in Checkout drop-downs.

 

Can you let me know where they’re nested?

 

 


The reason you are not seeing that in the conditional split drop-down is because you are currently set to filter properties about someone i.e profile level data. But actually what you need is to filter based on the event data that comes from the started checkout trigger.

Here's how you can achieve that:
1 . In your conditional split, change the drop-down from properties about someone to what someone has done (or not done).

2. Then you select started checkout as the event 

3. Click the plus Add Filter under it you can choose 
. Items: choose the nested field;  Item → Variant → Inventory quantity
 
And don't forget to set the logic as greater than 0

If this happens not to work out then I guess you product catalog might not be fully synced or probably could be the event metadata doesn't include the inventory info.


Thank you so much, truly appreciate it!

 

I’ve gotten as far as:

  • Person has: checkout started
  • Where: Items
  • Contains: ….. ?

Here is where it gets confusing for me:

The Contains drop down menu which lists every item in my online store.

It seems like my options are to pick an individual item.

BUT, I would like this Flow to be for any and all items, not just a specific item.

Even beyond that, if I do click and select a specific item I do not see any options for “Inventory quantity” 

 

Appreciate your help with this, thank you!!!


Yes klaviyo does not allow you to natively check nested event data like variant.inventoryQuality inside a conditional split filter and I thought you are making you of data?? but they are two workaround options 

1. If you only care about few products that might go out of stock, you can set up specific product based conditions.... Use " items contains (product name) them combine this with a tag or property you assign to that product in shopify ( like a meta field or tag for low stock. This isn't dynamic but works in some cases.

 

The second option is using custom event just I have mentioned earlier which I thought it was what you did. (automated) Making use of code or through a middleware like webhook or shopify flow.


Thanks so much, this would have to be for every item in my shop. I’m not comfortable coding nor do I have a budget for something like this, guess I’ll just hope Klaviyo integrates this sort of functionality one day...


Hi ​@KenH 

One other option, which does come with some drawbacks, is to add the Catalog lookup tag to the dynamic block in your email. 

{% catalog item.product_id unpublished="cancel" %} <a href="{{ event.extra.responsive_checkout_url }}"> <img src="{{ catalog_item.featured_image.thumbnail.src }}" alt="" width=""></a> {% endcatalog %}</div>
{% endif %}

Similar to you, I had a client that would have items go out of stock quickly and they were having customers frustrated by receiving emails for the items that had already gone out of stock.

The Catalog lookup references the product data sync’d from your ecommerce integration in Klaviyo and in this case, looks at the status of the product ID to see if the product is published or not. If the product is unpublished, this code will essentially block the email from being sent.

A couple of things to note:

  • You do need to code your dynamic product block image using the code above (+ any adjustments you might want (ie. image size, etc.) The code above also hyperlinks the image to the cart. If you don’t want to do that, you’d need to remove the <a href> tag. (But, I always recommend linking your images in the cart abandon)
  • If you use this… even if one item in the checkout email is out of stock, but there are other items in the cart that are still in-stock, this will block the email altogether. 

This second point should be the biggest consideration for weighing this approach. 

 

Now, one thing you could consider, but this will be dependent on how many products you sell and how many go out of stock, but you could also use the following to simply hide a product from the cart abandon email. Transparently, I have not done this, but as I was thinking about your use case, it could potentially work and it could offset the second bullet above. 

But, the draw back is you would have to manage and update this code per item (or maybe we collection) to hide the item from the dynamic product block.

 

{% if item.product.title != 'PRODUCT NAME' %}
YOUR PRODUCT INFO & HTML
{% endif %}

 

You would use this {% IF %} tag which essential “says” if product.title doesn’t equal PRODUCT NAME, then show this block. You would need to add this to both the image and text side of your product block. And, the Image would need to be coded using a text block and HTML to show the actual image vs. an image block.

Just a couple more options to consider.

I hope this helps!

@In the Inbox 


Hey ​@KenH,

I’d like to chime in and recommend the solution that ​@In the Inbox proposed. Unfortunately, much of the information provided by the other commenter doesn’t apply to your situation.

Adding the code snippet that In the Inbox provided to a block will allow the email to skip if one of the products is no longer published. Note that this will work best in flows triggered by Checkout Started. If you have a flow triggered by Added to Cart, you’d need to tweak the code a bit.

Note that you’ll want to add the code In the Inbox provided to the source code of a text block in your table. We have an article here that covers how to do this, if you prefer some visual guidance: https://help.klaviyo.com/hc/en-us/articles/115005253188#h_01J0V118WWR0C3RSDWEH4ZCXHR

That being said, don’t hesitate to reach back out to us if you have any additional questions.

-Byrne


Reply