Playbook
How to add an AI chat widget to your online store
By the RoutMe team. Last updated .
Adding an AI chat widget to an online store is two separate jobs. The first is placing a script snippet on every storefront page so the launcher appears. The second is connecting the assistant to your store data, read-only, so it can answer real questions. RoutMe has no native plugin for any store platform, so both jobs are done by hand using the steps your platform already supports.
Step 0: know what you are adding
A website chat widget is a small launcher plus a chat panel that loads from a script. In RoutMe, you create a widget in the dashboard, list the origins allowed to load it, and copy a snippet containing a widget key. The widget key is public by design, which is why the allowed origin list matters. The assistant does not get any store access from the snippet. Data comes from the second job below. If you are still choosing a tool, read how to choose an AI customer support agent.
Part 1: placing the snippet
Every platform offers a place to add custom code to all pages. Menus and plan requirements change, so follow the platform's own current documentation, and treat this as a map of what to look for.
| Platform | Where the snippet usually goes | Guide |
|---|---|---|
| Shopify | The theme's layout file, so it loads on every page | Shopify and the setup guide |
| WooCommerce | Enqueued from the theme, or a site-wide snippet plugin you trust | WooCommerce |
| BigCommerce | Script Manager, set to load on all pages | BigCommerce |
| Wix | Custom code in site settings, placed in the body or head of all pages | Wix |
| Squarespace | Code injection in settings, which may depend on your plan | Squarespace |
General steps that apply everywhere:
- Duplicate the live theme or create a preview, if the platform allows it.
- Paste the snippet where it loads on all storefront pages, preferably near the end of the page body.
- Confirm the origin of your store, including any
wwwvariant, is in the widget's allowed list. - Open the preview, check that the launcher appears, and send a test message.
- Publish, then test on a phone and a desktop browser.
Part 2: connecting read-only data
A widget with no data can answer questions from documents you add. To answer order, booking or stock questions, the agent needs a tool that reads your systems.
- Pick the narrowest interface. Each platform has an API for orders and products. Create a credential with read permission only and the fewest scopes that work.
- Put a small server in front of it. An MCP server exposes a handful of named tools, such as looking up an order, and keeps the credential on your side. The MCP guide explains the protocol.
- Mark tools read-only. Use the read-only annotation so clients know the tool does not change anything. The idea is explained in what read-only AI means.
- Require verification. A tool that returns an order should need the order number plus a second detail. The pattern is in how an AI agent looks up order status safely.
- Register the server in the RoutMe dashboard and run a connection test to confirm the tools are listed.
Each platform page lists the specific API and permission to use. Shopify merchants can also read the Shopify overview for the Storefront, Admin and Customer Account APIs. Skip any claim that the connection is automatic: it is not, today.
Platform-specific cautions
- Checkout. Some platforms restrict custom scripts on checkout pages. Treat the widget as a storefront feature unless the platform's documentation says otherwise.
- Customer accounts. Logged-in areas may use different templates, so verify the launcher there.
- Single-page behavior. Themes that swap content without full page loads sometimes need the widget initialized once. Test navigating between pages.
- Third-party app conflicts. Several floating chat buttons overlap. Remove the old one before you add the new one.
- Performance. Load the script asynchronously and compare page speed before and after.
- Privacy. Update your privacy policy and consent banner if the widget stores identifiers. See security and your own legal advice.
Testing before launch
Run a short checklist with real, harmless questions: a product question, an order status lookup with the right details, one with wrong details, a policy question from your documents, a request for a person and one out-of-scope question. The wrong-details test is the one that matters most, because the agent should refuse without leaking anything. Then check the handoff lands in your inbox, as described in human handoff best practices.
How RoutMe approaches this
RoutMe keeps the widget and the data connection separate on purpose. The snippet can be removed in a minute, and the data connection is a server you control, with credentials that never reach the browser. The agent is read-only by default, so it can look things up but cannot change orders. For stores comparing channels, WhatsApp vs website chat covers when each one earns its place, and retail and ecommerce shows how stores typically use it.
Sources
Explore the product: RoutMe for Shopify, solutions and the documentation.