Skip to main content
Shopify takes the SmartAlex widget as one script tag, pasted into your theme. Shoppers can then talk or type to your agent on any storefront page, for example to ask about shipping, sizes or returns. No app or plugin is needed.
In the app: Agent Settings → Widget → Install → Install code. In Shopify: Online Store → Themes → ⋯ → Edit code → theme.liquid.

What do I need first?

  • A SmartAlex agent that is active. If you have none, start with the quickstart.
  • Your tenant ID, which the Install code panel fills in for you. A connected AI app can fetch it too.
  • Edit access to your Shopify theme.
Turn the widget on with Show widget on my website under Agent Settings → Widget. The tag is the same for every style:

How do I paste it into theme.liquid?

This puts the widget on every storefront page.
1

Open the theme code

In Shopify admin go to Online Store → Themes. On your theme, click ⋯ and choose Edit code.
2

Open theme.liquid

Under Layout, open theme.liquid.
3

Paste above the closing body tag

Scroll to </body> and paste the tag on its own line directly above it, with your tenant ID in place of YOUR_TENANT_ID.
4

Save and check

Click Save, open your live store in a new tab and hard refresh once.
Editing the live theme applies at once. To test first, duplicate the theme, add the tag to the copy, preview it, and publish the copy afterwards.

How do I keep it in its own snippet?

A snippet keeps the tag in one named file that is easy to find and remove.
1

Create the snippet

In Edit code, under Snippets, click Add a new snippet and name it smartalex-widget.
2

Paste the tag into it

Paste the full script tag into snippets/smartalex-widget.liquid.
3

Render it from theme.liquid

Add this line just before </body>:

Which widget style suits a store?

You choose the style in Agent Settings → Widget. Widget v2 gives voice and chat in one window. Pill is a small floating button, Chat bar and Side panel suit stores that prefer text, and Voice pill is voice only. See Widgets.

Can the agent answer order questions?

General answers such as shipping policy and sizing come from your agent’s knowledge, but answering for one order needs a live lookup. A Custom HTTP Tool does that: the agent calls an HTTPS endpoint you host, passes the order number, and reads back what your endpoint returns. Your endpoint is where you talk to the Shopify Admin API, and Custom HTTP Tools need the Power Tools add-on (add-ons and prices).
Never expose customer order data on an open endpoint. Require a secret, look up one order at a time, and return only what the shopper asked for. The agent sees only what your endpoint returns.

How do I check it works?

  1. Open your live store in a private window and check the widget shows on the home page and a product page.
  2. Send a text message such as “what are your shipping times” and check the agent replies.
  3. If you chose a voice style, start a call and check the audio connects.
  4. Check the chat appears in your Inbox as a Website conversation.

Questions people ask

No. You add the widget with one script tag in your theme. It needs no app and no plugin.
Yes, with a Custom HTTP Tool. During the chat, the agent calls an HTTPS endpoint you host, passes the order number, and reads back the status your endpoint returns. Custom HTTP Tools need the Power Tools add-on.
Yes. Duplicate your theme, add the script tag to the copy, preview it, and publish the copy when you are happy.
No. The widget reads its style, colours and agent from SmartAlex when the page loads. Changes in Agent Settings → Widget show on the next page load.

Installing the widget

The full install guide and fixes.

Retail use case

How stores use an AI agent.

Agent tools

Set up the Custom HTTP Tool for order lookups.

Build overview

Guides for every other builder.
Last modified on November 27, 2026