{% endunless %}. The template variable in Shopify Liquid tells you which page type is rendering. The contains check catches both checkout and checkout.thank-you templates. If you want the bot only on product pages, use the opposite logic: {% if template == 'product' %}."}},{"@type":"Question","name":"What should I train a Shopify chatbot on?","acceptedAnswer":{"@type":"Answer","text":"A chatbot that answers 'Does this come in size XL?' or 'What is your return policy?' without forcing the visitor to leave the page is worth 5-10% in extra conversion. Train the bot on: your shipping rates and timing, your return / refund policy, top 20 product FAQs (sizing, materials, care), live chat handoff for complex issues, and out-of-stock handling and back-in-stock notifications. The bot should know your catalog well enough that visitors do not need to browse for basic information."}},{"@type":"Question","name":"How does a chatbot affect Shopify page speed?","acceptedAnswer":{"@type":"Answer","text":"A properly-async chatbot script loads in the background without blocking your page render. The script is typically under 10KB and loads in under 100ms. Compare this to typical Shopify chat apps that add 100-300KB of code and slow your Time to Interactive by 200-500ms. After adding the script, run PageSpeed Insights. A properly-async chatbot should add 0 to your Lighthouse score."}}]}]
All posts

How to Embed an AI Chatbot on Shopify (Step-by-Step)

March 7, 2026 · BotLauncher Team

Shopify's App Store is full of chatbot apps that charge $30–$100/mo on top of the actual bot. Here is how to skip all that and add a real AI chatbot to your store directly.

The Shopify App Store model makes sense for complex integrations, but for a simple chat widget, it's overkill. Most chatbot apps add layers of abstraction, admin interfaces, and billing overhead that you don't need. A direct script embed gives you the same functionality with zero ongoing app fees and better performance.

Step 1: Get your embed snippet

You'll need a script tag like:

<script async src="https://botlauncher.xyz/widget.js" data-bot-id="YOUR_ID"></script>

The async attribute ensures the script loads without blocking your page render. This is important for Shopify because page speed directly impacts conversion rates and SEO rankings.

Step 2: Add it to your Shopify theme

  1. Shopify admin → Online StoreThemes
  2. Click ActionsEdit code on your live theme
  3. In the left sidebar, open theme.liquid (under Layout)
  4. Find the </body> tag (use Ctrl+F)
  5. Paste the snippet on the line just above </body>
  6. Click Save

The bot now loads on every storefront page.

Important: work on a duplicate theme first

Never edit your live theme directly. Create a duplicate theme, make changes there, and preview before publishing. If you break the theme.liquid file, your entire store goes down. Working on a duplicate protects you from that risk.

What to do if you are using a Shopify 2.0 theme

Shopify 2.0 themes use a different structure. The theme.liquid file still exists in the Layout section, but you may also have layout/theme.liquid in the main directory. The </body> tag is typically found at the end of the file. If you cannot find it, use the search function (Ctrl+F) in the code editor.

Step 3: Test it

Visit your store in an incognito window. The chat widget should appear within 1–2 seconds. Try asking it a product question.

Check these specific scenarios:

  • Product page questions: "Does this come in blue?"
  • Shipping questions: "How fast is shipping to California?"
  • Return policy: "What's your return policy?"
  • Lead capture: "Can I get notified when this is back in stock?"

Should the bot appear on cart and checkout?

Generally no — most stores see better conversion when the bot is hidden on /cart and /checkout so it doesn't distract from the purchase. Wrap the snippet in a Liquid conditional:

{% unless template == 'cart' or template contains 'checkout' %}
  <script async src="https://botlauncher.xyz/widget.js" data-bot-id="YOUR_ID"></script>
{% endunless %}

The template variable in Shopify Liquid tells you which page type is rendering. The contains check catches both checkout and checkout.thank-you templates.

If you want the bot to appear only on product pages, use the opposite logic:

{% if template == 'product' %}
  <script async src="https://botlauncher.xyz/widget.js" data-bot-id="YOUR_ID"></script>
{% endif %}

Pro tip: train the bot on your product catalog

A chatbot that answers "Does this come in size XL?" or "What's your return policy?" without forcing the visitor to leave the page is worth 5–10% in extra conversion. Give the bot:

  • Your shipping rates and timing
  • Your return / refund policy
  • Top 20 product FAQs (sizing, materials, care)
  • Live chat handoff for complex issues
  • Out-of-stock handling and back-in-stock notifications

The bot should know your catalog well enough that visitors don't need to browse for basic information. Every time a visitor leaves your site to find an answer, you risk losing them to a competitor.

Performance considerations

Shopify stores are already heavy with analytics, pixels, and app scripts. Adding a chatbot should not make it worse. The lightweight script approach:

  • Loads asynchronously (doesn't block rendering)
  • Weighs under 10KB
  • Has no dependencies on jQuery or other libraries
  • Doesn't add admin interface code to your dashboard

Compare this to typical Shopify chat apps that add 100–300KB of code and slow your Time to Interactive by 200–500ms.

Why this approach beats app store chatbots

The Shopify App Store model is designed for complex integrations — inventory management, email marketing, subscription billing. For a simple chat widget, it adds unnecessary overhead:

  • App fees: $30–$100/mo on top of the chatbot service
  • Performance: 100–300KB of additional JavaScript
  • Admin: a new dashboard to manage
  • Updates: app updates that may conflict with your theme
  • Lock-in: if the app goes out of business, you lose the chatbot

The direct script approach is faster, cheaper, and simpler.

Troubleshooting

If the bot doesn't appear:

  1. Check the console for JavaScript errors
  2. Verify the bot ID in the data-bot-id attribute
  3. Confirm the script is in the right place (before </body>, not in the <head>)
  4. Check for theme conflicts — some themes heavily customize theme.liquid
  5. Test with all other apps disabled to identify conflicts

If the bot appears but answers are wrong, check your training data in the BotLauncher dashboard. The bot answers based on what it has been trained on — if your product catalog has changed, update the bot's knowledge base.

The conversion impact

Ecommerce stores that add a chatbot see 5–10% lift in conversion rate. The reason is simple: the bot removes the friction of finding information. A visitor who can't find an answer leaves. A visitor who gets an answer in 10 seconds is more likely to buy.

For a Shopify store doing $100,000/month in revenue, a 5% conversion lift = $5,000 in additional monthly revenue. The chatbot costs a fraction of that.

Get your Shopify-ready embed snippet, trained in 72 hours.

Using Shopify for your service business? Browse industry examples for cleaning services, med spas, and gyms.

Using WordPress instead? Read our WordPress chatbot embed guide →.

Want to understand the ROI? Read our chatbot ROI calculator with real numbers →.

Frequently Asked Questions

Why should I avoid a Shopify chatbot app?

Shopify's App Store is full of chatbot apps that charge $30-$100/mo on top of the actual bot. Most add layers of abstraction, admin interfaces, and billing overhead that you don't need. A direct script embed gives you the same functionality with zero ongoing app fees and better performance. Most Shopify chat apps add 100-300KB of code and slow your Time to Interactive by 200-500ms. The lightweight script approach weighs under 10KB and loads asynchronously.

How do I add a chatbot to Shopify without breaking my store?

Never edit your live theme directly. Create a duplicate theme first, make changes there, and preview before publishing. If you break the theme.liquid file, your entire store goes down. The steps: 1. Shopify admin → Online Store → Themes. 2. Click Actions → Edit code on a duplicate theme. 3. Open theme.liquid (under Layout). 4. Find the </body> tag (use Ctrl+F). 5. Paste the snippet on the line just above </body>. 6. Click Save. Preview the duplicate theme. If everything looks good, publish the duplicate.

Should the chatbot appear on cart and checkout pages?

Generally no — most stores see better conversion when the bot is hidden on /cart and /checkout so it does not distract from the purchase. Wrap the snippet in a Liquid conditional: {% unless template == 'cart' or template contains 'checkout' %} <script async src='https://botlauncher.xyz/widget.js' data-bot-id='YOUR_ID'></script> {% endunless %}. The template variable in Shopify Liquid tells you which page type is rendering. The contains check catches both checkout and checkout.thank-you templates. If you want the bot only on product pages, use the opposite logic: {% if template == 'product' %}.

What should I train a Shopify chatbot on?

A chatbot that answers 'Does this come in size XL?' or 'What is your return policy?' without forcing the visitor to leave the page is worth 5-10% in extra conversion. Train the bot on: your shipping rates and timing, your return / refund policy, top 20 product FAQs (sizing, materials, care), live chat handoff for complex issues, and out-of-stock handling and back-in-stock notifications. The bot should know your catalog well enough that visitors do not need to browse for basic information.

How does a chatbot affect Shopify page speed?

A properly-async chatbot script loads in the background without blocking your page render. The script is typically under 10KB and loads in under 100ms. Compare this to typical Shopify chat apps that add 100-300KB of code and slow your Time to Interactive by 200-500ms. After adding the script, run PageSpeed Insights. A properly-async chatbot should add 0 to your Lighthouse score.

Ready to launch your own AI assistant?

Done-for-you setup in 72 hours. Plans from $19/mo.