chatty4allBuild your assistant

How to add an AI chatbot to Shopify

Updated · 3 min read

On Shopify, the chatbot goes into your theme's main layout file, theme.liquid, so it appears on every page your theme draws.

Before you start

  1. Build your assistant in the Chatty4All editor: pick a design, then teach it about your business.
  2. Under Go live → Websites it may run on, add your website's address. The assistant only loads on the sites listed there, so nobody can copy your code onto theirs.
  3. Publish it. The editor then shows your code with your own assistant id in place of YOUR_BOT_ID.

Your code

This is the whole install. Copy yours from Go live in the editor: it's the same line with your id filled in.

HTML
<script src="https://chatty4all.design/widget.js" data-bot="YOUR_BOT_ID" async></script>

Add it to Shopify

  1. In Shopify admin, go to Online Store → Themes → ⋯ → Edit code.
  2. Open layout/theme.liquid and paste the line just before </body>.
  3. Save and preview your store.

Tips for Shopify

  • Code edits belong to one theme. If you publish a different theme later, add the line to that theme too.
  • Teach it your shipping, returns and sizing pages under Teach it → Knowledge, so its answers match your policies.
  • To look up orders, connect your Shopify store under Teach it → Actions and choose which actions it may use.

Showing the chat inside a page instead

For the Inline layout, use a Custom Liquid section on the page where the chat should appear and paste the line there.

Check it worked

  • Open your live site in a private window. The chat button should appear in the corner within a few seconds.
  • If it says it isn't enabled for this site, add that exact domain under Go live → Websites it may run on.
  • If nothing appears, check that you published the assistant and that the line is on the page (view the page source and search for widget.js).

Would you rather let your AI coding assistant do it? See install the chatbot with Cursor, Claude, Lovable, v0 or Bolt.