Skip to content
Log in

▶️ Use script blocks

On this page

1. Create a script block

  1. Go to the Script Blocks list (StoreConnect NavigationCustom Content).
  2. Select New.

2. Configure the script block

  1. Give the script block a Name, for example “Chatbot Embed”.
  2. Assign it to your Store.
  3. Set the configuration:
    • Active — check this to enable the script block.
    • Channels — select Web for your online store, POS for the point of sale app, or both. This field is required.
    • Global — check this to include the script on every page. Leave it unchecked and the script block is not included on your store at all.
    • Position — the order script blocks load in. Lower numbers load first.
  4. Add your script, using one of:
    • Content — paste the script itself, written without <script> tags. StoreConnect adds them for you.
    • Script URL — load the script from an external source instead. If you set this, any value in Content is ignored.
  5. Select Save.

3. Test the script

  1. Go to your storefront and refresh the page.
  2. Confirm the script does what you expect. A chatbot, widget, or tracking tool should now appear and function as configured.

The script block is rendered in the <head> of every page on your store, wrapped in <script> tags, or as <script src="..."> when you set Script URL.

Notes and best practices

  • Turn a script block on or off at any time with the Active checkbox. You do not need to delete it.
  • Script blocks suit chatbots, Google Analytics, Facebook Pixel, custom widgets, and marketing tags.
  • Liquid code does not work inside script blocks. If your script needs Liquid, use the head content block instead. See Adding custom JavaScript, CSS and head content.
  • Test on a staging store first where you can, especially for analytics or tracking scripts.

:::note

If you link a script block to a Cookie record for privacy compliance, it only loads for visitors who have consented to that cookie. Script blocks with no linked cookie always load.

:::

Was this article helpful?

Was this article helpful?