How to add a chatbot to Shopify
ChatAgents is an AI chatbot builder that can address customer concerns, set appointments, answer account-related questions, generate leads, log internal requests, and more.
Create a fully-functional AI chatbot with our $0 plan (free forever).
Chatbots are great additions to Shopify stores. They give customers a convenient way to voice their concerns, and brands to solve them through quick responses.
Installing a chatbot to your Shopify store is as easy as pasting an embed code to your store's backend.
Before we head to your store's backend, let's first find your embed code.
Copy your chatbot embed code
This section will vary depending on your chatbot builder. In this guide, we'll use ChatAgents as the example.
To get started:
- In your ChatAgents dashboard, go to Agent Channels > Website.
- Toggle on Enable Embed.
- Click Copy Code.
Now that you have your code, it's time to paste it on your Shopify theme.
Add the chatbot to your Shopify store
- Log in to your Shopify admin
- Go to Online Store > Themes
- Find your current theme and click Actions > Edit Code
- In the left sidebar, open the Layout folder
- Click to open the theme.liquid file
- Scroll to the bottom of the file
- Paste your embed code just before the closing </body> tag
- Click Save
Your chatbot will now appear across your entire store.
Tip: If you're using a third-party or custom theme, consider creating a backup before editing theme files.
Restrict access to logged-in users (optional)
If your chatbot is only meant for logged-in users—such as customers, members, or internal staff—you can enable restricted access in ChatAgents.
- Go to Agent Channels > General
- Scroll to the Authorization section
- Toggle on Authorized User Only
- Copy the Secret Key
- Make sure your Shopify theme only loads the chatbot script for authenticated users
For full setup instructions, see:
Create an AI Chatbot for Logged-In Users
Once installed, your chatbot will start responding on your site using the knowledge and workflows you’ve already configured. You can update its behavior, skills, and settings anytime from your ChatAgents dashboard.