How to add an AI chatbot to Shopify
How to add a chatbot to Shopify in 4 steps
Create the chatbot
Open the AI Chatbot editor and enter your store’s address. The agent reads your pages and comes back with knowledge, a name, a tone and a welcome message.
Train it on your store
Add product, shipping and returns pages, files and Q&A pairs for the questions shoppers ask most.
Get the code
Adjust the look, click Add to website for free and copy the installation code.
Paste it into your theme
In Shopify admin go to Online Store → Themes → Customize, add a Custom Liquid section, paste the code and save.
What a Shopify chatbot does for your store
Answers before the sale — sizing, compatibility, stock, shipping times and returns, at any hour, when a shopper would otherwise leave.
Helps shoppers choose — asks what they need and points them to products that fit, with a link to the product page. See the AI shopping assistant.
Captures leads — collects emails and pre-sale questions for follow-up.
Hands off to you — shows your contacts (WhatsApp, email, phone) when it can’t help or a shopper asks for a person.
Shows what confuses shoppers — the chats reveal which product descriptions and policies need work.
Train the chatbot on your store’s content
Web pages
Add up to 200 pages: product and collection pages, shipping, returns, FAQ, About and contact.
Files
Upload catalogs, size charts or care guides as PDF, DOCX, TXT, JSON, HTML or MD (up to 100 MB each). A Shopify product export is a CSV, so save it in one of these formats first.
Q&A pairs
Write answers to the questions you get by email every week: “What’s your return policy?”, “Do you ship to Canada?”, “Do you sell gift cards?”
Text blocks
Paste your returns policy in plain words — not the legal version — and anything that isn’t on a page.
The agent builds each answer from all its knowledge, so a reply may not repeat your Q&A word for word. Hand-written Q&A and short summaries usually give better answers than long marketing copy. More in how to create a chatbot knowledge base.
Write instructions for a store assistant
Set the agent’s role, tone (Friendly, Professional, Casual, Direct or your own) and answer length, then add rules. An example to adapt:
You are Eva, the shopping assistant for [Store name].
Help customers find the right products and answer questions
about sizing, shipping and returns.
- Keep answers to 2–3 sentences unless asked for detail.
- When asked for a product, suggest 2–3 options from the store
with a link to each, and ask about budget or size if unclear.
- You can't take payments or place orders.
- For order status and account questions, send customers to
[your support email] or [your order status page].
- Never invent products, prices or policies.Read the first chats and adjust the rules where answers drift. See how to train an AI chatbot.
Add the chatbot to your Shopify theme
Pick a floating bubble for the whole store or an embedded chat inside a page, then add the code one of two ways.
On a page or template (theme editor)
Open the theme editor
In Shopify admin go to Online Store → Themes → Customize.
Choose the template
Use the drop-down at the top to open the page: Home page, Products, Collections or a specific page.
Add a Custom Liquid section
Click Add section, choose Custom Liquid and paste the installation code.
Save
Click Save and refresh your store. Adding it to the Products template shows it on every product page.
On every page (theme code)
Open the code editor
In Online Store → Themes, click … next to your theme and choose Edit code.
Open theme.liquid
In the Layout folder, open
theme.liquid.Paste and save
Paste the code just before the closing
</body>tag and click Save.
This works with Online Store 2.0 themes, free and paid themes, and any Shopify plan. Still on a vintage theme? Follow the Shopify installation guide ↗, or request free installation ↗.
Match the chatbot to your store’s design
Start from one of six themes, then set your brand color for every part of the chat and your store’s font.
Choose the launcher — a button, a text button, a quick input or the agent’s profile — and put it left, right or bottom center.
Give the agent a name, a picture and a caption such as “Here to help you choose”.
Need pixel-level changes? Use custom CSS.
Where to show the chatbot (and where not)
Product, collection and contact pages are where shoppers have questions. On the cart page, a chat bubble can distract from finishing the order — hide it there with a page URL rule, and check that it doesn’t cover the Add to cart button on phones. Shopify’s checkout doesn’t load your theme’s code, so the chatbot doesn’t appear there.
Shopify Inbox, chat apps or an AI chatbot?
Who answers
Shopify Inbox
Help desk chat apps
Custom-built bot
Elfsight AI Chatbot
Setup
Shopify Inbox
Help desk chat apps
Custom-built bot
Elfsight AI Chatbot
Best for
Shopify Inbox
Help desk chat apps
Custom-built bot
Elfsight AI Chatbot
The chatbot also works outside Shopify, so it stays if you move your store to another platform.
Troubleshooting
The chatbot doesn’t appear
Check that you pasted the whole code unchanged and saved; open the store in a private window to rule out the cache.
The code shows as text
You pasted it into a rich text field. Use a Custom Liquid section or
theme.liquidinstead.It covers buttons on phones
Change the position or offsets, or hide it on mobile for that page.
Chat emails don’t arrive
Check the recipients in the chatbot’s email notifications and your spam folder.
On this page