Out-of-Stock Items and Automated Flow Emails (Shopify)

read

Overview

If you often sell out of popular items, it's possible that a customer will place an item in his/her cart one minute and come back hours later to find the same item out-of-stock.

While abandoned cart and browse abandonment flows can drive significant revenue to your business, fast selling inventory can make it challenging to send reminders that don't fall flat. Encouraging customers to return to a cart full of out-of-stock items can lead to a frustrating customer experience.

To make sure out-of-stock items are not displayed in abandoned cart or browse abandonment emails, you will need to slightly update the way dynamic content is populated.

Note

Klaviyo will only "un-publish" out-of-stock items for Shopify stores if you do not allow customers to purchase products when they go out-of-stock.

The Abandoned Cart Flow

Klaviyo's default abandoned cart email templates feature a dynamic table that is used to populate each email with the specific items the recipient left behind in his/her abandoned cart.

If you would like an abandoned cart email to automatically be cancelled if it is going to feature one or more items that have since gone out-of-stock, you will need to adjust the image section of the existing dynamic table in a given template.

First, click on your dynamic table and click into Rows. Next, toggle Column 1 from Image to Text

Here, click into the Source of this text block. In the Source area, copy and paste the following snippet:

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

Make sure to click Source again before clicking Save Changes to save this snippet in your text block.

This will ensure that:

  • Before a given email in your flow is scheduled to send, Klaviyo will look up each item that will dynamically populate in the individual email
  • If any one item is "unpublished" in your catalog at time of lookup, the entire email will get skipped
  • For a given flow email, you can navigate to Analytics > Recipient Activity > Other and see a category labeled: Skipped: Catalog Item Unavailable
  • This is where you can view all emails that were cancelled -- i.e. skipped -- because an item featured in the email was out-of-stock or otherwise unavailable (if the item is no longer in your catalog)

It is not possible to remove a single out-of-stock item from an email and send the rest of the email as scheduled. If at least one item in a cart has gone out of stock, the entire email will be cancelled.

The Browse Abandonment Flow

Klaviyo's default browse abandonment email template features a static table block that is used to populate each email with the specific item a recipient browsed your website.

If you would like browse abandonment emails to automatically be cancelled if they are going to feature an item that has since gone out-of-stock, you will need to adjust the image section of the existing table in a given template.

First, click on this table block and navigate to Rows. Next, toggle Column 1 from Image to Text.

Here, delete the text "First Column" and click into the Source of this text block. In the Source area, copy and paste the following snippet:

{% catalog event.ProductID unpublished="cancel" %} 
<a href="{{ catalog_item.url }}"><img src="{{ catalog_item.featured_image.full.src }}" width="200" /></a> 
{% endcatalog %}

After pasting this snippet, make sure to click Source again before clicking Save Changes to save this snippet in your text block.

This will ensure that:

  • Before a given email in your flow is scheduled to send, Klaviyo will look up the item that will dynamically populate in the individual email
  • If this item is "unpublished" in your catalog at the time of lookup, the email will be skipped
  • For a given flow email, you can navigate to Analytics > Recipient Activity > Other and you will see a category labeled: Skipped: Catalog Item Unavailable
  • This is where you can view all emails that were cancelled -- i.e. skipped -- because an item featured in the email was out-of-stock or otherwise unavailable (if the item is no longer in your catalog)

How to Test Out-of-Stock Feature

The best way to test out this feature is to:
  • Adjust your email templates as explained above
  • View an item on your site and/or start a checkout with a single item in your cart
  • Wait until you see your tracked event appear in your account's activity feed
  • Temporarily mark this single item out-of-stock in your store's backend
  • Navigate to the flow that is triggered by the action you took (Viewed Product or Started Checkout) and has your newly adjusted email templates
  • Click to preview one of these emails, and make sure the "choose a recent event to preview with" window features your own recent event
  • When you click Preview, you should see a preview where the item's image doesn't populate and instead the following message appears: Item (XXXXXX) is not published and unavailable.
692342
Was this article helpful?
0 out of 0 found this helpful