▶️ Use script blocks
On this page
1. Create a script block
- Go to the Script Blocks list (StoreConnect Navigation → Custom Content).
- Select New.
2. Configure the script block
- Give the script block a Name, for example “Chatbot Embed”.
- Assign it to your Store.
- 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.
- 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.
- Content — paste the script itself, written without
- Select Save.
3. Test the script
- Go to your storefront and refresh the page.
- 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?
Thanks for your feedback! It helps us improve our docs.