Skip to main content

How do I set up a Back in stock form?

How to add a "notify me when back in stock" button to your Shopify product pages using a Back in stock form.

Written by Peter

A Back in stock form adds a Notify when back in stock button to your Shopify product pages. When inventory is sold out, visitors can click the button, submit their contact details, and get notified when it becomes available again.

Setting one up takes two steps: creating the form (including choosing where the button appears) and enabling the Spoks Onsite Javascript.

Only one Back in stock form can exist per store.

Theme compatibility

The Back in stock button is injected into your Shopify product pages, so it depends on your theme's structure. Spoks aims to support:

  • Free Shopify themes — Themes offered by Shopify in the theme library are supported. Please let us know if you are using a free Shopify theme that is not compatible.

  • Custom themes — Supported where possible. Since custom themes vary widely in structure, some may need small adjustments to work correctly. Using the Custom element button placement (see Step 1 below) gives you the most control if the default placements don't work in your theme. Other than that, feel free to reach out, but Spoks cannot adapt the Back in stock functionality to cover all possible scenarios.

Step 1: Create the Back in stock form

Create a new form in Spoks and choose Back in stock as the type. Configure the form's questions and appearance like any other form — Back in stock forms have an Email question by default, but you can add more questions if you want.

By default, Back in stock forms have status LIVE so they work right away. If a form already exists on your store, the option to create a new one is disabled — you'll need to delete the existing form first.

Choose where the button appears

Under the form's Back in stock settings tab, choose where the Notify when back in stock button should appear on your product pages:

  • Replace Add to Cart button — The button takes the place of the Add to Cart button when inventory is sold out.

  • Below Add to Cart button — The button appears below the Add to Cart button when inventory is sold out.

  • Custom element — The button is injected into any element on your theme that has the data-spoks-bis-trigger attribute. You control the placement by adding an element with that attribute to your theme — for example, <div data-spoks-bis-trigger></div>.

For details on configuring forms, see Creating or editing a form or poll.

Step 2: Enable the Spoks Onsite Javascript

Back in stock forms need the Spoks Onsite Javascript to be enabled in your Shopify theme. This is a one-time setup that applies to all Spoks features that needs it that run on your store.

When you save the form, the How to use this form dialog appears with an Enable Javascript button that takes you to the Shopify theme editor and pre-enables the setup. Save your theme, and the JavaScript is active.

How subscriptions work

When a visitor submits the form for a sold-out product, they're subscribed to that specific variant, not the product as a whole. If a product has multiple variants (like sizes or colors), each variant tracks its own subscribers, and each can trigger its own notifications when it comes back in stock. How and when the notifications trigger depends on how the Back in stock flows have been configured.

For more on notifying subscribers, see How do I trigger a flow when a product is back in stock?.

When the button appears

The button only shows on product pages where all of these are true:

  • The inventory is sold out.

  • The product doesn't have Shopify's "Continue selling when out of stock" option enabled.

  • The product matches the form's product targeting rules (if any are set).

  • The form's status is LIVE.

If any of these aren't met, the button won't appear on that product page.

Set up notifications

Creating the form only handles the signup side — it lets visitors subscribe when inventory is sold out. To actually notify them when the product comes back in stock, you also need a flow that runs on the Back in stock trigger.

Without a flow, subscribers will sit in the queue but never receive a notification.

Did this answer your question?