Skip to content

Install the widget on Shopify

View as Markdown

You can add the AgentMySite support chat in two places on Shopify:

  • Your online store: the chat appears on your storefront for shoppers.
  • Your embedded Shopify app: if you build a Shopify app with Remix, the chat appears inside your app for the merchants who use it.
  1. In AgentMySite, go to Site Settings > Allowed domains and add every hostname your store uses, for example your-store.myshopify.com and www.your-store.com.

  2. In your Shopify admin, go to Online Store > Themes. Next to your current theme, open the ⋯ menu and select Edit code.

  3. Open layout/theme.liquid.

  4. Paste your embed snippet just before the closing </body> tag, then select Save.

    layout/theme.liquid
    <script async src="https://widget.agentmysite.com/loader/widget.js" data-site-key="YOUR_SITE_KEY" data-api-base="https://api.agentmysite.com" data-iframe-origin="https://widget.agentmysite.com"></script>
    </body>
  5. Open your storefront. The chat button appears in the bottom-right corner.

  1. Open a page where you added the widget. The chat button appears in the corner.

  2. Ask a question your content answers.

  3. In your browser’s developer tools, open Network. You should see widget.js with status 200, then POST /widget/session with status 200, not 401.

If /widget/session returns 401, the page’s hostname isn’t in your allowed domains. For other problems, see Troubleshooting.