Add an AI chatbot to Shopify with one line in theme.liquid
No app install, no permission grants, no theme rewrite. Train it on your product, shipping and returns pages and it answers shoppers in their own language — citing the page it read.
<script src="https://customerbot.co/script.js" data-bot-id="YOUR_BOT_ID"></script>What is a Shopify chatbot?
A Shopify chatbot is a chat widget on your storefront that answers shopper questions automatically instead of routing them to email. The useful kind is trained on your own product, shipping and returns pages, so it quotes your delivery window and your refund window rather than guessing, recommends between products you actually sell, and hands over to a person when the question needs one.
Shopify ships three AI surfaces of its own and they are easy to confuse. None of them is an unattended, storefront-side assistant, which is the specific gap worth understanding before you pay for anything.
Shopify Inbox
Shopify’s own free chat widget, with tappable Instant Answers and AI-suggested replies for whoever is staffing the inbox.
It assists a person rather than standing in for one. Nobody on shift, no answer.
Shopify Sidekick
An assistant inside the admin that drafts product copy, builds automations and pulls reports for you.
It talks to you, not to your shoppers. It never appears on the storefront.
The Shop app assistant
Discovery and recommendations for shoppers browsing inside Shopify’s consumer Shop app.
It lives in Shopify’s marketplace rather than your theme, and you do not control what it says.
A trained assistant, like this one
Reads your own product, shipping and returns pages and answers from them unattended, in 95+ languages, citing the page it used.
Order status and live stock are not on those pages — those need an API tool you point at your own endpoint.
The install, in full
- 1
Create the assistant and copy your bot ID
Sign up, paste your store URL and let it crawl. When the assistant is created you get a snippet with your own bot ID already filled in.
- 2
Open your theme code
In Shopify admin go to Online Store → Themes, then Actions → Edit code on the theme you are using. Duplicate the theme first if you would rather test on a copy.
- 3
Open layout/theme.liquid
This is the file wrapped around every page of the storefront, which is why one edit here covers product pages, collections, cart and the blog at once.
Layout └── theme.liquid ← this one
- 4
Paste the tag before </body>
Scroll to the bottom of the file. Put the snippet on its own line immediately above the closing body tag, then Save.
</main> <script src="https://customerbot.co/script.js" data-bot-id="YOUR_BOT_ID"></script> </body> </html>
- 5
Reload the storefront
The launcher appears in the corner you configured. Nothing else in the theme changes, and removing it later is deleting one line.
Six things to train it on first
A store crawl picks up everything, which is not always what you want. Start with the pages that answer money and delivery questions; add the rest once you have seen what visitors actually ask.
How crawling and re-training worksShipping policy page
Delivery times and zones — the most-asked pre-purchase question.
Returns & refunds page
Window length, condition rules, who pays return postage.
Product pages
Materials, dimensions, care, variants. Crawl the collection in bulk.
Size guide PDF
Uploaded as a document so the tables are readable, not just linked.
FAQ page
Whatever you already wrote to stop these emails the first time.
Q&A pairs
The five answers you retype every week, in your exact wording.
Two kinds of question, two kinds of answer
Most of what a store gets asked before checkout is already written down somewhere on the site. The rest changes by the minute, and no amount of crawling will keep up with it — that is what an API tool is for.
“When will this arrive in Germany?”
From a pageYour shipping policy page
“Can I return it if it does not fit?”
From a pageYour returns and refunds page
“Will this fit a 15-inch laptop?”
From a pageProduct page copy and the size guide PDF
“Which of these two suits a beginner?”
From a pageProduct pages plus your own Q&A pairs
“Do you ship to a PO box?”
From a pageYour shipping policy page
“Where is my order?”
Live dataYour order-lookup endpoint, as an API tool
“Is the medium back in stock yet?”
Live dataYour inventory endpoint, as an API tool
Fewer permissions, fewer moving parts
| Script tag | Typical embedded app | |
|---|---|---|
| Install | One line in theme.liquid | App install, permission grants, embed block |
| Storefront permissions | None — it is a script on your own page | Usually read access to products, orders, customers |
| Removal | Delete the line | Uninstall, then hunt the leftover theme code |
| Live order data | Via an API tool you configure and control | Often built in, at the cost of broader access |
A word on speed
The tag goes at the bottom of the body deliberately: the browser has already parsed and painted your product page before it fetches the widget. It is served from a CDN and does not block rendering. Put it in the head and you will undo that, so leave it where the instructions put it.
How much will it actually deflect?
Vendors publish deflection rates in the seventies and eighties. Treat those as a ceiling measured on well-run stores, not a starting point. What decides your number is not the model — it is whether your shipping page names countries and days, whether your returns page says who pays the postage, and whether your product copy answers the sizing question your emails keep asking. A store with vague policy pages gets a bot that is vague about policy.
The honest first month looks like this: train it, read the transcripts, and write down every question it fumbled. Those questions are the gap in your own documentation. Fill them in, re-train, and the deflection rate moves — usually more than switching tools would.
The five numbers worth watchingShopify-specific questions
What is a Shopify chatbot?
A Shopify chatbot is a chat widget on your storefront that answers shopper questions automatically instead of routing them to email. The useful kind is trained on your own product, shipping and returns pages, so it quotes your delivery window and your refund window rather than guessing, recommends between products you actually sell, and hands over to a person when the question needs one. It can be installed as an app from the Shopify App Store or, as here, with a single script tag in your theme.
Does Shopify have a built-in chatbot?
Not a fully autonomous one. Shopify Inbox is a free chat widget with tappable Instant Answers and AI-suggested replies, but it is built to help a human reply faster rather than to answer on its own. Sidekick is an admin assistant for you, not your shoppers, and the Shop app assistant runs inside Shopify’s marketplace rather than on your theme. Unattended, storefront-side answering still comes from a third-party assistant.
Is there a free Shopify chatbot?
Shopify Inbox is free, and CustomerBot has a free plan that crawls a real storefront and gives you a working assistant to interrogate before you touch theme.liquid. Paid plans raise message and training limits and remove the CustomerBot watermark from the widget.
Do I need to install a Shopify app?
No. CustomerBot is a script tag on your own storefront, so there is no app install, no permission grant and nothing in your Shopify admin to uninstall later. Removing it is deleting one line from theme.liquid.
Will it slow my store down?
The widget script is small, served from a CDN and loaded after your page content because the tag sits at the bottom of the body. It does not block rendering. If you are chasing a Core Web Vitals score, this is not the thing that will move it.
Can it look up a customer’s order?
Yes, if you give it an endpoint. Describe your order-lookup API in a sentence and CustomerBot generates the tool definition; the assistant then calls it mid-conversation, asks for the order number and reads the status back. You decide what that endpoint exposes.
Does it work with Online Store 2.0 themes?
Yes. theme.liquid exists in every Shopify theme, 2.0 included. If you prefer, you can also add it through a custom Liquid block in the theme editor — the tag is the same either way.
What about my checkout pages?
Shopify controls checkout and does not let you inject scripts into it on standard plans. Put the assistant on the storefront where the pre-purchase questions actually happen; that is where the deflection and the recovered sales are.
Can it recommend products?
It recommends from what it has read. Crawl your collections and it can steer a shopper who describes a use case towards the right product and link to it. It is not a merchandising engine ranking by margin — it is a well-read assistant that knows your catalogue copy.
Does it work on Shopify Plus?
Yes, and the install is identical. Plus additionally lets you edit checkout, though we would still keep the assistant on the storefront: the questions that lose you sales are asked before checkout, not during it.
Can a human take over a conversation?
Yes. The assistant escalates when a shopper asks for a person or when it is out of its depth, and the transcript travels with the conversation so nobody has to repeat their order number. Outside opening hours it takes an email instead of stranding them.
Will it answer in the shopper’s language?
It detects the language of each message and replies in it across 95+ languages, from a knowledge base you only maintain in one language. For a store selling across the EU this is usually the single biggest source of recovered conversations.
Where does my store content go?
Crawled pages and transcripts sit in your own workspace and are used to answer your shoppers, not to train a public model. Conversations are yours to export or delete, and you can delete the workspace outright from account settings.
Can it match my theme?
Primary, secondary and background colours, light or dark mode, launcher position and size, launch animation, avatar, header title and subtitle, placeholder and welcome copy are all configurable. On the Pro plan the CustomerBot watermark is removed.
Keep reading
Two minutes to a store that answers back
Crawl your storefront on the free plan and ask it your own returns policy before you touch theme.liquid.
Start free