Skip to content

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>:

HTML
<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").

HTML
<script src="https://agent.aiptimise.com/embed.js"
        data-store="YOUR-STORE-ID"
        data-label="Ask our assistant" async></script>

Allowed sites#

Only your store's own sites may show its agent, so another site cannot pass your assistant off as its own. The chat page sends a frame-ancestors policy with:
  • 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#

If your site sends a Content-Security-Policy, allow https://agent.aiptimise.com in three directives: the script, its availability check and the chat frame.
HTTP header
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 and app/root.tsx
// 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#

Set in Settings → Store Agent, not in the tag, so changes need no deploy.
SettingChoices
LayoutFloating window, or a side panel.
Panel sideLeft or right.
Button positionBottom right, bottom left, middle right or middle left.
ColorsAiptimise’s, or (on Shopify, through the app embed) your theme’s brand colors.