Browse docs
Shopify stores and apps
Add the Axoryn widget to a Shopify storefront theme, or embed it in your Shopify admin app, where it detects the merchant's store on its own.
This page covers the two ways to use Axoryn with Shopify: on a store’s storefront, for shoppers, and inside a Shopify admin app you build, for the merchants who use your app.
Add the widget to a storefront
On a storefront, the widget works like on any other site.
- In Shopify admin, go to Online Store → Themes → Edit code.
- Open
layout/theme.liquidand paste the snippet right before</body>. - Save, then open your store.
<script src="https://api.axoryn.io/widget.js"
data-project-key="YOUR_WIDGET_KEY" async></script>
Shoppers start as anonymous visitors. The widget asks for a name or email when it needs one, as described in What visitors can do.
If you set Allowed sites for the project, add the domains your store is served on, for example yourstore.com and *.myshopify.com.
Embed the widget in a Shopify admin app
If you build a Shopify app, you can give the merchants who use it a support chat inside your app’s admin pages. Paste the same snippet into the HTML your embedded app serves, before </body>. No extra configuration is needed.
When the page runs inside the Shopify admin with App Bridge, the widget detects it from the window.shopify global that App Bridge provides:
- It only treats the page as an admin embed when App Bridge reports that the app is embedded. A storefront is never mistaken for an admin embed.
- The store comes from App Bridge’s shop setting, or from the
?shop=parameter in the page URL. - The store’s domain becomes the visitor’s name, so conversations do not show as anonymous.
- The store’s domain appears in the inbox, in the visitor panel under Shopify store.
- The pre-chat form and the widget’s name and email ask are skipped, because the store already identifies the visitor.
Note: In an admin embed, the widget ignores
window.axorynIdentity. To attach your own user id, email oruser_hash, callAxoryn.identify()after the widget script has loaded. See Identify your users.
Allowed sites for an admin app
Your embedded app runs in an iframe on your app’s own domain, so the widget’s requests come from that domain, not from admin.shopify.com. If you set Allowed sites, add your app’s domain (for example app.yourapp.com).
Content-Security-Policy
If your app sends a Content-Security-Policy, add the widget’s sources as described in Install the Axoryn widget.