Store agent
Embed on your site
One script tag adds a button that opens the store's agent in a panel. On a Shopify theme store, use the app embed instead: it adds the same script without editing your theme.
Add the tag#
Copy the tag from Settings → Store Agent in Aiptimise, where your store id is filled in, and add it to every page that should show the assistant, for example in your site's shared layout before </body>:
<script src="https://agent.aiptimise.com/embed.js"
data-store="YOUR-STORE-ID" async></script>The script asks Aiptimise whether the agent is on for your store. If it is not, it shows nothing. If it is, it adds the button; the chat itself opens in a frame of https://agent.aiptimise.com.
Optional: data-label sets the button text (up to 60 characters; the default is "Ask our shopping assistant").
<script src="https://agent.aiptimise.com/embed.js"
data-store="YOUR-STORE-ID"
data-label="Ask our assistant" async></script>Allowed sites#
- Your store's website as set in Aiptimise, with and without
www. - Your Shopify domain (
*.myshopify.com), for Shopify stores. - Any other sites you list under Settings → Store Agent → "Other sites of yours", one origin per line (for example
https://shop.example.com).
On any other site the button may appear, but the browser refuses to show the chat. Add staging and preview hosts to the list while you test.
Content-Security-Policy#
https://agent.aiptimise.com in three directives: the script, its availability check and the chat frame.Content-Security-Policy:
script-src … https://agent.aiptimise.com;
connect-src … https://agent.aiptimise.com;
frame-src … https://agent.aiptimise.com;On a Hydrogen storefront:
// app/entry.server.tsx
createContentSecurityPolicy({
shop: {checkoutDomain: …, storeDomain: …},
scriptSrc: ['https://agent.aiptimise.com'],
connectSrc: ['https://agent.aiptimise.com'],
frameSrc: ['https://agent.aiptimise.com'],
});
// app/root.tsx: Hydrogen's <Script> adds your CSP nonce
import {Script} from '@shopify/hydrogen';
<Script src="https://agent.aiptimise.com/embed.js" data-store="YOUR-STORE-ID" async />Appearance#
| Setting | Choices |
|---|---|
| Layout | Floating window, or a side panel. |
| Panel side | Left or right. |
| Button position | Bottom right, bottom left, middle right or middle left. |
| Colors | Aiptimise’s, or (on Shopify, through the app embed) your theme’s brand colors. |