fbpx
klaviyo-back-in-stock

How to Set Up and Optimize Klaviyo Back-in-Stock Alerts and Flows for Shopify

by Giles ThomasLast updated on October 22, 2024

Klaviyo’s back-in-stock notifications help eCommerce brands recover lost sales by alerting customers when out-of-stock items are available again. This feature is especially useful for stores using Shopify, BigCommerce, Magento 2, or custom catalog feeds.

1. Introduction to Klaviyo’s Back-in-Stock Feature

Back-in-stock alerts allow customers to subscribe to notifications for restocked products, ensuring they don’t miss out. By integrating this feature, you’ll create a seamless experience for customers, increasing conversions.

2. Key Components of the Back-in-Stock Flow

Klaviyo’s back-in-stock setup consists of two main components:

  • Subscribed to Back-in-Stock Event: When a customer subscribes to be notified about a product restock, Klaviyo tracks this event and triggers the back-in-stock flow.
  • Website Button: You need to add a snippet to your store’s theme, which shows a “Notify Me When Available” button for out-of-stock products.

Klaviyo Back In Stock website button

Here’s how the button works:

  • When the product is out of stock, the button appears.
  • Customers click the button, enter their email, and subscribe to the notification.

3. Setting Up a Back-in-Stock Flow

Klaviyo Back In Stock API key

To set up a back-in-stock flow, you can use pre-built templates in Klaviyo or create a custom flow from scratch. Follow these steps to create the flow and integrate it with Shopify.

For Shopify Integration:

  1. Navigate to your Shopify Admin > Online Store > Themes.
  2. Click on Actions > Edit Code.
  3. Open the theme.liquid file and paste the following code just above the </body> tag:
html
<script src="https://a.klaviyo.com/media/js/onsite/onsite.js"></script>
<script>
var klaviyo = klaviyo || [];
klaviyo.init({
account: "YOUR_PUBLIC_API_KEY",
platform: "shopify"
});
klaviyo.enable("backinstock", {
trigger: {
product_page_text: "Notify Me When Available",
product_page_class: "button",
product_page_text_align: "center",
product_page_margin: "0px",
replace_anchor: false
},
modal: {
headline: "{product_name}",
body_content: "Register to receive a notification when this item comes back in stock.",
email_field_label: "Email",
button_label: "Notify me when available",
subscription_success_label: "You're in! We'll let you know when it's back."
}
});
</script>
  1. Replace "YOUR_PUBLIC_API_KEY" with your actual Klaviyo public API key, found in the account settings.
  2. Save the changes to enable the back-in-stock feature.

4. Customizing the Back-in-Stock Emails and Button

You can personalize the notification emails using Klaviyo’s dynamic event variables, ensuring real-time product data (such as product images, pricing, and variants) are displayed. The back-in-stock button and form are also highly customizable:

  • Adjust colors, fonts, and text in the snippet to match your store’s theme.

For example, modify the button text alignment or margin:

javascript
product_page_text_align: "center",
product_page_margin: "10px",

You can also place the button in different areas of the product page by moving the snippet in your product.liquid file.

5. Best Practices for Back-in-Stock Flows

  • Pre-built flows: Klaviyo offers pre-built flows that already implement best practices.
  • Sending frequency: Space out messages to avoid overwhelming customers. Smart Sending can help by ensuring that non-essential emails aren’t sent too frequently.
  • Related flows: In addition to back-in-stock, consider adding abandoned cart or post-purchase flows to boost conversions further.

6. Back-in-Stock Flow Settings

You can adjust the following settings to ensure efficient inventory notifications:

  • Minimum Inventory Rules: Define the threshold of items that need to be restocked before sending notifications. For example, only notify subscribers when more than 5 items are restocked.
  • Customer Notification Rules: You can batch notifications or send them all at once. If stock is limited, sending emails in small batches based on inventory can prevent disappointing customers who miss out.

7. Testing and Troubleshooting

Once your back-in-stock flow is set up, it’s essential to test it before going live. Here’s a step-by-step testing process:

  1. Set a test product’s inventory to zero.
  2. Verify the “Notify Me” button appears on the product page.
  3. Subscribe to the notification.
  4. Restock the product and ensure the back-in-stock email is sent.
  5. Adjust any display or functionality issues within your theme code if needed.

Common troubleshooting tips include checking theme compatibility and ensuring the snippet is correctly placed in the theme.liquid file.

8. Monitoring and Performance Optimization

Klaviyo provides robust analytics to monitor the performance of your back-in-stock flows. You can:

  • Track subscriber engagement, email open rates, and conversions.
  • Export reports to monitor the effectiveness of your notifications.

To view performance, navigate to the flow analytics page in Klaviyo and check the Back-in-Stock Reports. You can also subscribe to regular email updates on flow performance.

9. Additional Resources

Klaviyo offers plenty of additional resources to help you get the most out of the back-in-stock feature:

Conclusion

By setting up Klaviyo’s back-in-stock notifications, you’ll offer a better customer experience and recover potential lost sales when products sell out. The feature is flexible, customizable, and a valuable addition to any eCommerce store’s marketing arsenal.