Guide

How to add an AI chatbot to Shopify

How to add a chatbot to Shopify in 4 steps

  1. 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.

  2. Train it on your store

    Add product, shipping and returns pages, files and Q&A pairs for the questions shoppers ask most.

  3. Get the code

    Adjust the look, click Add to website for free and copy the installation code.

  4. 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

  1. Web pages

    Add up to 200 pages: product and collection pages, shipping, returns, FAQ, About and contact.

  2. 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.

  3. 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?”

  4. 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)

  1. Open the theme editor

    In Shopify admin go to Online Store → Themes → Customize.

  2. Choose the template

    Use the drop-down at the top to open the page: Home page, Products, Collections or a specific page.

  3. Add a Custom Liquid section

    Click Add section, choose Custom Liquid and paste the installation code.

  4. Save

    Click Save and refresh your store. Adding it to the Products template shows it on every product page.

On every page (theme code)

  1. Open the code editor

    In Online Store → Themes, click … next to your theme and choose Edit code.

  2. Open theme.liquid

    In the Layout folder, open theme.liquid.

  3. 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?

Shopify Inbox
Help desk chat apps
Custom-built bot
Elfsight AI Chatbot
Who answers
Mostly you and your team, from the admin or mobile app
Your team, with some automation
The AI model you connect
An AI agent on the latest top-tier AI models, trained on your store
Setup
Install from the Shopify App Store
App install and a setup wizard
Developers, API keys, hosting
Visual editor, one code in the theme
Best for
Small stores with someone always online
Teams that already run a help desk
Stores with unique needs and a tech team
Stores that want answers around the clock without coding

Who answers

Shopify Inbox

Mostly you and your team, from the admin or mobile app

Help desk chat apps

Your team, with some automation

Custom-built bot

The AI model you connect

Elfsight AI Chatbot

An AI agent on the latest top-tier AI models, trained on your store

Setup

Shopify Inbox

Install from the Shopify App Store

Help desk chat apps

App install and a setup wizard

Custom-built bot

Developers, API keys, hosting

Elfsight AI Chatbot

Visual editor, one code in the theme

Best for

Shopify Inbox

Small stores with someone always online

Help desk chat apps

Teams that already run a help desk

Custom-built bot

Stores with unique needs and a tech team

Elfsight AI Chatbot

Stores that want answers around the clock without coding

The chatbot also works outside Shopify, so it stays if you move your store to another platform.

Troubleshooting

  1. 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.

  2. The code shows as text

    You pasted it into a rich text field. Use a Custom Liquid section or theme.liquid instead.

  3. It covers buttons on phones

    Change the position or offsets, or hide it on mobile for that page.

  4. Chat emails don’t arrive

    Check the recipients in the chatbot’s email notifications and your spam folder.

Frequently asked questions

Official documentation

Shopify: customizing sections ↗

help.shopify.com/en/manual/online-store/themes/customizing-themes/theme-editor/customizing-sectionsShopify: customizing sections ↗

Related

How to create an AI chatbot for a website

The fastest way to create a chatbot for a website is a no-code builder: enter your site’s address, check what the agent learned, set its tone and welcome message, then paste one code into your site.How to create an AI chatbot for a website