How Do I Prevent Browse Abandonment Flow Emails from Showing an Out-of-Stock Product?
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
Page 1 / 1
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.
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:
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
Thanks so much for the quick and helpful response Taylor! I will try this out!
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.
Or would the change target the unpublished piece of the snippet?
Really appreciate your help!
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?
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
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
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.
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!
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:
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 Metric's tab, under Analytics.
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 (Number) is not published and unavailable.
David
Hi @David To and @Taylor Tarpley
I have some questions please:
Does the code look like this in the new editor?
Do I need to apply this code to ALL the emails in my browse abandonment flow?
Thank you!
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.
In Klaviyo, open the browse abandonment flow email template you wish to edit.
Click on your dynamic table. Under Content, you'll see Column 1 currently selected.
If Column 1 is currently set to Image, toggle it to Text.
Under Cell Content, click the Source code icon.
Copy and paste the following snippet into the source code text box:
Once you've finished, click Done in the upper left.
Save your template.
Hope this helps!
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?
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:
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 Metric's tab, under Analytics.
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 (Number) is not published and unavailable.
David
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.
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
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?