Skip to main content

Enabling Spoks Onsite Javascript on your store

Set up the one-time JavaScript activation that powers popup, embedded, and Back in stock forms on your Shopify store.

Written by Peter

The Spoks Onsite Javascript is what allows certain Spoks features to run on your Shopify store. It's a one-time setup that applies to all current and future features that depend on it. This article walks you through enabling it.

What requires the Spoks Onsite Javascript

The following Spoks features need the Spoks Onsite Javascript to be enabled before they'll appear on your store:

  • Popup forms — Overlay forms shown to visitors based on triggers like time delay, scroll, or exit intent.

  • Embedded forms — Forms placed directly inline on a page of your store using the Spoks Embedded Form block.

  • Back in stock forms — The "Notify when back in stock" button that appears on sold-out product variants.

Without the Spoks Onsite Javascript enabled, these features won't be displayed even if they're otherwise correctly configured.

Note that while the Spoks Onsite Javascript works on any Shopify theme, embedded forms specifically require an Online Store 2.0 theme. See How do I add an embedded form to my store? for details.

Enabling the Spoks Onsite Javascript

The Spoks Onsite Javascript is enabled in the Shopify theme editor — but rather than navigating there manually, Spoks provides a button that takes you directly to the right place and pre-enables the embed block. All you need to do is save your theme.

The button lives in the How to use this form dialog inside Spoks. There are two ways to open this dialog, depending on whether you're setting up a brand new form or working with an existing one.

From the post-save dialog

When you save a popup, embedded, or Back in stock form for the first time, the How to use this form dialog appears automatically. To enable the Spoks Onsite Javascript:

  1. Click Enable Javascript in the dialog.

  2. Wait for the Shopify theme editor to load.

  3. Save your theme.

Once the theme is saved, the Spoks Onsite Javascript is active across your entire store.

From an existing popup, embedded, or Back in stock form

If you've already created a form of any of these types — for example, before completing the JavaScript setup, or because you skipped the post-save dialog — you can open the How to use this form dialog at any time:

  1. Go to the forms page in Spoks. On web this is a table; on mobile it's a list.

  2. Click (or tap) any of your popup, embedded, or Back in stock forms — it doesn't matter which, since the setup applies to all of them.

  3. Click the information button in the top-right corner of the form's overview.

The How to use this form dialog opens. From there:

  1. Click Enable Javascript.

  2. Wait for the Shopify theme editor to load.

  3. Save your theme.

What else you need for forms to appear

Enabling the Spoks Onsite Javascript is the first step — but for a popup, embedded, or Back in stock form to actually appear on your store, it also needs to have status LIVE. A DRAFT form is not displayed, even if the Javascript is enabled.

For embedded forms, you also need to add the Spoks Embedded Form block to your theme. See How do I add an embedded form to my store? for the full setup.

For Back in stock forms, the "Notify when back in stock" button also has additional conditions before it appears on a product page — for example, the inventory must be sold out, and the product must match any product targeting rules. See How do I set up a Back in stock form? for the full setup.

You can change a form's status from the form editor. For more on configuring forms, see Creating or editing a form or poll.

Did this answer your question?