Assistrio
Back

Shopify AI chatbot setup: install it, connect your orders and go live

On this page

To add a Shopify AI chatbot, copy the Shopify version of your chat code, paste it into layout › theme.liquid just above </body> and save. Then connect your store through a .myshopify.com sign-in so the agent can look up orders, and test it in a private window before customers find it.

You run a Shopify store. Someone asks "has my order shipped?" at 11 pm, another wants to know if the linen shirt runs small, and by morning there are fifteen emails whose answers already sit in your admin. This guide covers the setup itself: the theme install, real order data, and testing. Budget about an hour.

  • A Shopify AI chatbot is an AI agent on your storefront that answers from your policies and, once connected, from live orders, stock and carts.
  • Use the install code built for Shopify, not the generic snippet. Only the Shopify version recognizes signed-in shoppers.
  • The chat shows on every page that uses theme.liquid, but never on checkout, the Thank you page or a password page.
  • Switch on order tracking first, add returns and carts later, and keep anything that changes an order behind your approval.

Your Shopify prep list: access, domains and policies

Before you touch code, check that you can edit the theme, which addresses shoppers use, and that your policies are written down.

  • Theme access. A staff account with the Themes and Edit code permissions. Any Shopify plan works.
  • Every address shoppers use. Your own domain (say northlinen.com) and northlinen.myshopify.com. If shoppers reach both, add both; in Assistrio they count as 2 of the 3 websites each agent allows.
  • Policies in writing. Shipping times and countries, the return window, who pays return postage, sizing notes.
  • Your top ten questions. Copy the ten most common customer emails word for word, for testing later.

Any Shopify customer service AI is only as good as the policies behind it, so add your shipping, returns and FAQ pages to the Knowledge Base (our guide on what to feed a chatbot and what to keep out covers this in depth). One Shopify tip: sizing tables often hide inside single product descriptions, so add one sizing page and the agent can answer "what size is a 32 waist?" anywhere.

Install the Shopify AI chatbot in theme.liquid

Paste one short block of code into your live theme's theme.liquid file, just above </body>, and save. The Shopify AI chatbot then shows on every storefront page, with nothing to publish.

  1. 1

    Copy the Shopify code

    In Assistrio, click Deploy and pick Shopify under Website builders. Add your store's address under Allowed websites first; Copy code stays off until you do.

  2. 2

    Open your theme files

    In Shopify admin go to Online Store › Themes. Next to the theme marked Current theme, click the ⋯ menu, then Edit code.

  3. 3

    Find theme.liquid

    Open layout › theme.liquid (or use Search files).

  4. 4

    Paste above </body>

    Scroll to the bottom and paste the code on the line just above </body>. Not in a section or snippet file.

  5. 5

    Save and check

    Click Save. Open your store in a private browser window and look for the chat button at the bottom right.

Tip

Nervous about the live theme? Click ⋯ › Duplicate, paste the code into the copy and use Preview. Then publish the copy or paste into the live theme.

Why not a Custom Liquid section on the homepage? A section only appears on its own template, so the chat would vanish on product pages, exactly where sizing questions come up. The theme.liquid file wraps every storefront page. That's the whole job when you add a chatbot to Shopify. Other builders are covered in our guide to adding a chatbot to any website, and every Shopify detail is in the Shopify install docs.

Why the Shopify version of the code matters

The code from Deploy › Shopify includes a few lines of Liquid that sign a logged-in shopper's customer ID with your agent's secret key (Shopify's hmac_sha256 filter). So "where's my order?" gets answered without asking for an order number. The plain Chat Widget code skips this. Anyone with theme access can read the key, so treat Edit code access like a password.

Connect your store so the Shopify AI chatbot can look up orders

The installed Shopify AI chatbot can't see orders until you connect your store once under Build › Actions. It takes about two minutes.

  1. 1

    Find your .myshopify.com address

    In Shopify admin, open Settings › Domains.

  2. 2

    Open the Shopify card

    Go to Build › Actions and pick an action on the Shopify card, such as Retrieve and display orders.

  3. 3

    Sign in and approve

    Type the .myshopify.com address, sign in and approve Assistrio in Shopify.

  4. 4

    Set how guests prove it's their order

    Choose email, phone number or either. Guests give the order number plus that detail first.

Now a guest who types "order #1047, sam@example.com" gets status and tracking in the chat. The Shopify integration page lists everything the connection allows.

Which Shopify chatbot actions should you switch on first?

Start with order tracking and product cards, since they change nothing in your store. Add returns, carts and orders after a week of real chats.

ActionWhat shoppers getChanges your store?When to add it
Retrieve and display ordersOrder status and tracking in the chatNoDay one
Retrieve and display productsProduct cards with photo, live price and stockNoDay one
Get cart / Update cartSee and edit the real store cartCart onlyWeek two, once product answers look right
Create return or exchangeStarts a return inside your return windowYes, needs approvalWhen your return policy is clear in writing
Create orderOrder with a Pay now link, cash on delivery or freeYes, needs approvalOnly if you sell in the chat on purpose
Tag an orderAdds one of up to 10 tags you chooseYes, needs approvalFor flags like "gift wrap" or "address check"

Be choosy: Free and Starter give each agent 5 actions, Pro gives 10 (see plan limits). Anything that changes the store asks you to Allow in Shopify first, and an exchange arrives as a draft order tagged "exchange" for your team to approve.

Honestly, the agent only reports what Shopify knows. If you add tracking numbers two days after packing, the chat says "not shipped yet" for two days, so add a snippet explaining your packing time. More on answering versus acting in AI agent vs chatbot; every setting is in the Shopify actions docs.

Test your Shopify chatbot like a shopper before launch

Run your ten inbox questions through the Playground, then repeat three on the live store in a private window, as a guest and signed in.

A store owner at a laptop testing a Shopify AI chatbot with real customer questions before going live
Photo by Vitaly Gariev on Unsplash

The Playground shows each answer's sources and whether an action ran. A test set that suits most stores:

  • "Do you ship to Canada and how long does it take?" (policy answer, should quote your shipping page)
  • "Has order #1047 shipped?" as a guest, then signed in (the second should skip the email check)
  • "Is the linen shirt in stock in medium?" (product card with live stock)
  • "These jeans are too small, can I swap them?" (return window check, then the exchange flow or a handoff)
  • "I want to talk to a person" (should hand over cleanly, not loop)

If an answer is wrong, fix the source and ask again; knowledge-only mode stops the agent guessing about return windows. For the person request, the Live chat action pauses the AI and opens a Helpdesk ticket (on Pro) with the full chat. See what the Playground can check.

Why isn't your Shopify chatbot showing?

A missing chat usually means the wrong theme, the wrong file, or a page Shopify keeps theme code off. Work down this list.

What you seeLikely causeFix
No chat button anywhereCode saved in a draft themePaste it into the theme marked Current theme and save
Chat on the homepage onlyCode added as a Custom Liquid sectionRemove the section and paste into layout › theme.liquid
No chat while you preview a store not yet launchedPassword page uses password.liquidRemove the password, or view the store as a logged-in staff member
Missing on checkoutShopify checkout doesn't load theme codeExpected. Answer pre-checkout doubts on the cart page instead
Works on myshopify.com, not your domainOnly one address in Allowed websitesAdd the domain shown in the browser's address bar; subdomains need their own entry
Gone after a theme switchEach theme has its own filesPaste the code into the new theme's theme.liquid
Signed-in shopper asked for an order numberGeneric code used, or key rotatedCopy the code from Deploy › Shopify again and replace it

Still stuck? Open the browser console and look for an [Assistrio Chat] message naming what's missing. And check Visibility is on in Deploy › Chat Widget.

What to do next

Do these in order, and keep each one small so you can see what changed.

  • Copy your ten most common customer emails today and turn the answers into Knowledge Base sources or Q&A pairs.
  • Duplicate your live theme, paste the Shopify code into the copy and preview it on your phone and laptop.
  • Connect your store and switch on order lookups and product cards only. Leave returns and orders for week two.
  • Read every chat log in Activity › Chat logs for the first week, then add one action at a time. If you want to try this on your own store, Assistrio has a 7-day trial with no credit card.

Frequently asked questions

Build your AI support agent with Assistrio

Upload files, add your website or connect Notion and Google Drive, and go live in minutes.