{"title":"▶️ Use script blocks","slug":"how-to-use-script-blocks","url":"https://support.storeconnect.com/articles/how-to-use-script-blocks","url_markdown":"https://support.storeconnect.com/articles/how-to-use-script-blocks.md","subtitle":null,"summary":"Add third-party scripts like chatbots, Google Analytics, or Facebook Pixel to your store by creating script blocks with inline code or external URLs, applied globally or per page.","type":"Videos_Tutorials","video_url":"https://vimeo.com/1197572317?fl=sv\u0026fe=ci","keywords":null,"last_modified":"2026-08-21T07:12:35+0000","body_markdown":"## 1. Create a script block\n\n1.  Go to the **Script Blocks** list (**StoreConnect Navigation** → **Custom Content**).\n2.  Select **New**.\n\n## 2. Configure the script block\n\n1.  Give the script block a **Name**, for example \"Chatbot Embed\".\n2.  Assign it to your **Store**.\n3.  Set the configuration:\n    -   **Active** — check this to enable the script block.\n    -   **Channels** — select **Web** for your online store, **POS** for the point of\n        sale app, or both. This field is required.\n    -   **Global** — check this to include the script on every page. Leave it unchecked\n        and the script block is not included on your store at all.\n    -   **Position** — the order script blocks load in. Lower numbers load first.\n4.  Add your script, using one of:\n    -   **Content** — paste the script itself, written **without** `\u003cscript\u003e` tags.\n        StoreConnect adds them for you.\n    -   **Script URL** — load the script from an external source instead. If you set\n        this, any value in **Content** is ignored.\n5.  Select **Save**.\n\n## 3. Test the script\n\n1.  Go to your storefront and refresh the page.\n2.  Confirm the script does what you expect. A chatbot, widget, or tracking tool should\n    now appear and function as configured.\n\nThe script block is rendered in the `\u003chead\u003e` of every page on your store, wrapped in\n`\u003cscript\u003e` tags, or as `\u003cscript src=\"...\"\u003e` when you set **Script URL**.\n\n## Notes and best practices\n\n-   Turn a script block on or off at any time with the **Active** checkbox. You do not\n    need to delete it.\n-   Script blocks suit chatbots, Google Analytics, Facebook Pixel, custom widgets, and\n    marketing tags.\n-   Liquid code does not work inside script blocks. If your script needs Liquid, use the\n    head content block instead. See\n    [Adding custom JavaScript, CSS and head content](adding-custom-javascript-css-and-head-content).\n-   Test on a staging store first where you can, especially for analytics or tracking\n    scripts.\n\n:::note\n\nIf you link a script block to a **Cookie** record for privacy compliance, it only loads\nfor visitors who have consented to that cookie. Script blocks with no linked cookie\nalways load.\n\n:::"}