Solved

How Do I Prevent Browse Abandonment Flow Emails from Showing an Out-of-Stock Product?


Badge +3

Hi there,

 

I’ve looked all over and can’t seem to find the right answer, so hoping some good tips may surface here! 

I can’t figure out how to adjust my Browse Abandonment email to not fire when a user has browsed an out of stock product. I really don’t like that we’re sending emails to people about a product they can’t buy! 

How do I make it so that the Browse Abandonment flow (using WooCommerce) filters out of stock products to not trigger the flow? Or, better yet, filters such that a different flow occurs calling for recipients to Join Waitlist for the product to come back in stock?

 

Really appreciated any guidance!

 

Thanks

 

icon

Best answer by Taylor Tarpley 29 March 2022, 23:43

View original

15 replies

Badge +5

Hey @David To, as I understand it, the  “Item (Number) is not published and unavailable.” should only be available for a preview with a product that’s out of stock.

Question: Why does it also show when I preview products that are not out of stock? Is this normal?

Thanks again Taylor. Just implemented and will be monitoring.

 

Got a follow up question here -- we have a ‘waitlist’ feature on our site where people can join a product Waitlist for out of stock items, and receive notification when the item comes back in stock (that piece sent via a non-Klaviyo system).

 

I was wondering if I’d be able to clone my Browse Abandonment flow, and adjust it to be a “Waitlist” flow.

 

Could I take that snippet you shared and change it so that it the emails fire only when an item is out of stock? I’d then change the email body of course to have a call to action to join the Waitlist.

 

Would it look something like this?

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

 

Or would the change target the unpublished piece of the snippet?

 

Really appreciate your help!

Hi Jack,

 

did this work for your woocommerce store? Klaviyo support chat are telling me it wouldn’t work for Woocommerce

Userlevel 7
Badge +60

Hey @jeynon,

When you say you’ve tested it, did you happen to send yourself a test email? 

What you’ve shown in your screenshot is completely normal as I’ve previously mentioned in this thread. In case you missed my comment: 

@AlRousseau, is the message you’re seeing “Item (Number) is not published and unavailable.” when previewing the email? If so, then this is completely and a normal expected behavior. This is simply to inform you that the preview contains a product that is out of stock and will be hidden as mentioned in the seventh step of the How to test your out-of-stock feature subsection of our How to configure out-of-stock items for automated flows on Shopify Help Center article Taylor previously linked:

How to test your out-of-stock feature

You can test this feature by:

  1. Adjust your email templates as explained above.
  2. View an item on your site and/or start a checkout with a single item in your cart.
  3. Wait until you see your tracked event appear in your account's Metric's tab, under Analytics.
  4. Temporarily mark this single item out-of-stock in your store's backend.
  5. Navigate to the flow that is triggered by the action you took (Viewed Product or Started Checkout) and has your newly adjusted email templates.
  6. Click to preview one of these emails, and make sure the "choose a recent event to preview with" window features your own recent event.
  7. When you click Preview, you should see a preview where the item's image doesn't populate and instead the following message appears: Item (Number) is not published and unavailable.

David

Badge

I’ve tested this and it doesn’t seem to prevent the email from sending but rather it just says to the user that the email they just received has an out of stock product. I don’t think this is a viable solution. Am I missing something? 

 

Userlevel 7
Badge +60

Hey @krmq 

If you would like browse abandonment emails to automatically be canceled 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.

  1. In Klaviyo, open the browse abandonment flow email template you wish to edit.
  2. Click on your dynamic table. Under Content, you'll see Column 1 currently selected.
  3. If Column 1 is currently set to Image, toggle it to Text.
    Table block content tab in Klaviyo template editor with Column 1 set to text
  4. Under Cell Content, click the Source code icon.
    Cell content section of Table block content tab with source code icon selected
  5. Copy and paste the following snippet into the source code text box:
    {% catalog event.ProductID unpublished="cancel" %} 
    <a href="{{ catalog_item.url }}">
    <img src="{{ catalog_item.featured_image.full.src }}" style="width: 200px;" width="200px" /></a>
    {% endcatalog %}
  6. Once you've finished, click Done in the upper left.
  7. Save your template.

Hope this helps!

Badge +5

Hi @David To and @Taylor Tarpley 

I have some questions please:

  1. Does the code look like this in the new editor?

 

  1. Do I need to apply this code to ALL the emails in my browse abandonment flow?

 

Thank you!

Userlevel 7
Badge +60

Hey @Pollyk,

I think you may have misunderstood. We’re not actually advising you to manually temporarily mark your products as “unpublished” when they’re out of stock. Stock information is actually shared to Klaviyo in the backend automatically if you’re using a native ecommerce integration. For this reason, when you do run out of stock of a product, Klaviyo will automatically recognize this and consider those products as “unpublished”. Hence why we’re able to identify not to show those products when using the solution provided by Taylor and omit them from emails using a product block populated by your catalog. 

Additionally, because stock information is recognized by Klaviyo, we’re able to allow visitors to subscribe to our back in stock notifications. The back in stock notification only activates when Klaviyo is made aware that a product has zero inventory and is unavailable for purchase. In fact, this is the main reasons we require an $inventory_quantity field when setting up a custom catalog feed if you intend to use back in stock

@AlRousseau, is the message you’re seeing “Item (Number) is not published and unavailable.” when previewing the email? If so, then this is completely and a normal expected behavior. This is simply to inform you that the preview contains a product that is out of stock and will be hidden as mentioned in the seventh step of the How to test your out-of-stock feature subsection of our How to configure out-of-stock items for automated flows on Shopify Help Center article Taylor previously linked:

How to test your out-of-stock feature

You can test this feature by:

  1. Adjust your email templates as explained above.
  2. View an item on your site and/or start a checkout with a single item in your cart.
  3. Wait until you see your tracked event appear in your account's Metric's tab, under Analytics.
  4. Temporarily mark this single item out-of-stock in your store's backend.
  5. Navigate to the flow that is triggered by the action you took (Viewed Product or Started Checkout) and has your newly adjusted email templates.
  6. Click to preview one of these emails, and make sure the "choose a recent event to preview with" window features your own recent event.
  7. When you click Preview, you should see a preview where the item's image doesn't populate and instead the following message appears: Item (Number) is not published and unavailable.

David

Badge

Hi @Taylor Tarpley - I tried the above solution and it does not skip the email but rather replaces the image with a text message. Have I misunderstood your direction or the expected outcome?

“if a product is out of stock ie the quantity is 0 this code will still prevent emails from sending in the browse abandonment flow. “

Thanks for the assist!

Badge +3

Hi,

I’ve run into this problem as well and don’t find the solution works for me; I don’t want to ‘unpublish’ any of my products because they need to exist in order for my customers to sign up for restock notifications. It seems like bad practice to advise people to unpublish temporarily out of stock products.

Are there any plans for Klaviyo to add “stock” to their list of dimensions? 

I wouldn’t regard this issue as solved.

Badge

Hello @Taylor Tarpley.

 

We’ve been working through this flow and it works great except for variants that are out of stock. It appears that it only works if every variant is out of stock, not just one. Is it possible to make it so that it skips the email if the specific variant the customer added to cart is out of stock? Any help or guidance would be greatly appreciated.

 

Best,

Abby

Userlevel 7
Badge +60

Hi @jack1234

 

I think you’re talking about a Building a Back in Stock Flow. There is specific documentation and configuration needed to create this flow  that I would encourage you to investigate that already exists!

 

To answer your question @CodyGG, yes  if a product is out of stock ie the quantity is 0 this code will still prevent emails from sending in the browse abandonment flow. 

 

Happy to help!

-Taylor

Badge
  • If this item is "unpublished" in your catalog at the time of lookup, the email will be skipped

 

I’m going to try this out but In my case I need to leave all products published and active on sales channels so they can still display on our website and users can see the previous items in the collection, though they are limited-time exclusive drops that will never re-stock. Will this still work for my scenario or is there something that can be done specifically for products with 0 quantity?

 

Thanks!

Badge +3

Thanks again Taylor. Just implemented and will be monitoring.

 

Got a follow up question here -- we have a ‘waitlist’ feature on our site where people can join a product Waitlist for out of stock items, and receive notification when the item comes back in stock (that piece sent via a non-Klaviyo system).

 

I was wondering if I’d be able to clone my Browse Abandonment flow, and adjust it to be a “Waitlist” flow.

 

Could I take that snippet you shared and change it so that it the emails fire only when an item is out of stock? I’d then change the email body of course to have a call to action to join the Waitlist.

 

Would it look something like this?

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

 

Or would the change target the unpublished piece of the snippet?

 

Really appreciate your help!

Badge +3

Thanks so much for the quick and helpful response Taylor! I will try this out!

Userlevel 7
Badge +60

Hi @jack1234,

 

Thanks for sharing your question with us. Happy to help here! 

 

Definitely agree that something needs to be done about this as this is not a great user experience! If you want to prevent a browse abandonment flow from sending when the dynamically displayed item is out of stock, you will need to make a small update to the code in those templates, explained in our Help Center Documentation here. This is a one-time update that will prevent the abandonment emails from sending moving forward.

 

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

2020-01-07_14-15-57.png

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 }}" style="width: 200px;"
width="200px" /></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 canceled -- 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)

 

Hope this helps! Thank you for participating in the Community!

-Taylor 

Reply