Skip to content
// guide

How to add an AI chatbot to Shopify

Add an AI chatbot trained on your shipping, returns and product docs to Shopify: paste one line into theme.liquid above </body>. Two-minute guide with fixes.

  • Updated
  • 4 min read
  • add an ai chatbot to shopify
On this page
  1. What do you need before you start?
  2. Step 1: How do you build the store chatbot?
  3. Step 2: How do you copy the snippet?
  4. Step 3: How do you paste the code into theme.liquid?
  5. How do you add the chat to a single Shopify page?
  6. How do you fix common Shopify problems?
  7. How do you keep product answers current?
  8. How do you handle shoppers who need a person?
  9. How much does a Shopify chatbot cost to run?
  10. What should the welcome message and starter questions say?
  11. What should you check after launch?
  12. FAQ

You can add an AI chatbot to Shopify in about two minutes by pasting one line of code into your theme. The chatbot answers shoppers' questions about shipping, returns, sizing and products, using only your store's own policies and product information. Here's the full process, plus how to put the chat on a single page and fix common issues.

What do you need before you start?

  • Shopify admin access with permission to edit themes.
  • Your store information: shipping policy, refund policy, size charts, FAQ and, optionally, a product CSV export.
  • A free InstantKnowledgeBot account: sign up here.

Step 1: How do you build the store chatbot?

  1. In InstantKnowledgeBot, click New bot and choose the E-commerce store template. It's set up to answer shipping, returns, sizing and product questions, and never to invent prices, stock levels, discount codes or delivery dates.
  2. Add your knowledge. The quickest way is to import your store from its URL or sitemap; cart, checkout and account pages are skipped automatically (how website import works). Shopify policy pages are also easy to copy: open Settings → Policies in Shopify, copy each policy and paste it in. Upload size charts, an FAQ document or a product CSV too.
  3. Replace every placeholder in the template's starter FAQ if you use it.
  4. Set the name, accent color and welcome message.
  5. Test it in the Test tab: ask about shipping to another country, a return after 40 days, and something you don't sell.

Read why these guardrails matter on the Shopify AI chatbot page.

Step 2: How do you copy the snippet?

Open the bot's Embed & share tab, choose Chat bubble, and copy the code:

<script src="https://instantknowledgebot.com/widget.js" data-bot="YOUR_BOT_ID" defer></script>

Step 3: How do you paste the code into theme.liquid?

  1. In Shopify admin, go to Online Store → Themes.
  2. Back up first: next to your current theme, click ⋯ → Duplicate.
  3. Next to your current theme, click ⋯ → Edit code.
  4. In the file list, under Layout, open theme.liquid.
  5. Find the closing </body> tag near the bottom of the file (use your browser's find, Ctrl+F or Cmd+F).
  6. Paste the snippet just above </body>.
  7. Click Save.

Open your storefront in a new tab and refresh. The chat bubble appears in the bottom corner on every storefront page.

How do you add the chat to a single Shopify page?

If you'd rather show the chat inline on your Contact or FAQ page:

  1. In Embed & share, copy the Inline iframe code.
  2. In the theme editor (Online Store → Themes → Customize), open the page template, add a Custom Liquid section where the chat should appear, and paste the iframe code. On older themes, edit the page under Online Store → Pages and use the editor's Show HTML (<>) button to paste it.
  3. Save.

See iframe and share link embedding for sizing tips.

How do you fix common Shopify problems?

ProblemFix
Bubble doesn't appearMake sure you edited the live theme, not a duplicate, and that the snippet is above </body>.
Bubble appears twiceThe snippet was pasted twice, or in both theme.liquid and a section. Keep one.
Bubble overlaps another widgetMove it with data-position="left" on the script tag, or set Widget position in the bot's settings.
Answers are out of dateUpdate the documents in the bot's Knowledge tab; no theme change is needed.

How do you keep product answers current?

There's no live product sync. If your catalogue changes often:

  • Upload a fresh CSV export after big changes and remove the old one.
  • Or leave prices out of the knowledge base and let the bot link shoppers to product pages for current prices and stock.
  • Keep policies in the knowledge base word for word. They change less often and drive most questions.

How do you handle shoppers who need a person?

The bot doesn't include live chat or order lookups. Set a fallback message with your support email for questions it can't answer, and turn on lead capture (Pro and Agency, and during the free trial) so shoppers can leave their email and question for your team. The e-commerce template's preset is titled "Get help from our team". See set up chatbot lead capture.

How much does a Shopify chatbot cost to run?

The free plan includes one bot and 100 hosted AI messages a month. Busy stores can choose a paid plan, buy message packs that never expire, or connect their own OpenAI, Claude, Gemini or Grok key for unlimited messages billed by the provider: bring your own AI key. Compare plans on the pricing page.

What should the welcome message and starter questions say?

The welcome message is the first thing shoppers see when they open the chat, and the starter questions (up to six) are buttons they can tap. Good choices for a store:

  • Welcome message: short and specific, for example "Hi! Ask me about shipping, returns, sizing or any product."
  • Starter questions: your most common pre-purchase questions, such as "How long does shipping take?", "What's your return policy?", "How do I find my size?" and "Do you ship internationally?"

Change them seasonally. Before the holidays, a starter question like "What's the last day to order for Christmas delivery?" (with the answer in your knowledge base) can save your team a lot of email.

What should you check after launch?

For the first few weeks, check the bot's overview weekly:

  • Top questions tell you what shoppers care about. Consider adding those answers to product pages too.
  • Knowledge gaps show questions your policies didn't cover. Add the answers.
  • Thumbs-down answers point to documents that need clearer wording.

Frequently asked questions

Do I need a Shopify app to add the chatbot?

No. The chatbot is one script tag that you paste into your theme's theme.liquid file. No app install is needed.

Will the chatbot survive a theme update or theme change?

Code you add to a theme stays with that theme. If you switch to a different theme, paste the snippet into the new theme's theme.liquid too.

Can the chatbot check order status?

No. It answers from your documents and doesn't connect to Shopify orders. It can explain how to track an order using the steps in your policies.

Does the chatbot appear on the checkout page?

Checkout pages are controlled by Shopify and generally don't load theme code, so the bubble appears on your storefront pages: home, collections, products, cart and content pages.

Can I put the chatbot on one page only?

Yes. Paste the inline iframe code into a Custom Liquid section or a page's HTML editor, for example on your Contact or FAQ page.

Turn your docs into an AI chatbot today.

Free plan forever, no card needed. Upload your files and get a bot that answers from them in under a minute.

Last updated: · InstantKnowledgeBot