StoreSpan
Injectables

Installing the loader

Putting the StoreSpan script on your storefront, by hand or automatically, and allowing a local development store.

Open Store › Settings › Installation. The page says what it is for: Set up the loader that shows your content on the storefront — choose how it installs, copy the snippet if you place it by hand, and add any localhost origins you develop against.

Two ways to install

The switch Install the loader automatically picks between them.

Off, install by hand (recommended). Copy the snippet from this page and paste it as high as possible in your storefront's <head>, before other app scripts, so the loader is found and downloaded first. In BigCommerce this is usually done through Storefront › Script Manager with a script placed in the Head on all pages. The loader loads asynchronously and does not hold up your page.

On, install automatically. StoreSpan adds the script to your store through the BigCommerce Scripts API. This does not happen the moment you flip the switch; it happens on the next catalog sync. It also needs the app to hold the Content permission on your store. The page shows one of these lines while the switch is on:

  • Automatic install runs only when the app holds the Content scope…
  • The loader script is installed automatically via the BigCommerce Scripts API.
  • Automatic loader install failed, likely because the app lacks the Content scope. Paste the snippet below to install it manually.

Installing by hand boots the loader faster because it sits at the top of the page, which is why it is the recommended route.

The snippet

The snippet is made for your store and carries its write key and the address StoreSpan serves from. It contains two <link> hints that let the browser connect early and one <script> tag. Press Copy snippet to copy it. If the page shows placeholders such as YOUR_WRITE_KEY, the store is not fully set up yet; ask whoever set up StoreSpan for you.

One copy only

If your theme already has a StoreSpan snippet from an earlier install, remove that one first. Two copies load everything twice.

Developer origins

If someone develops your storefront on their own machine, add its localhost address here so the loader serves injectables to it. Enter a bare http or https localhost origin, for example http://localhost:3000. Any app served from that origin and port is trusted, and a change takes effect within a minute. Only localhost origins are accepted, and there is a limit on how many you can add.

On this page