How to add a custom AI chatbot to your Webflow website
· 6 min read
Webflow gives you full control over your site's markup, and adding an AI chat assistant is one of the simplest things you can do with it. The chat's one line of code goes into your site's custom code settings, once, and appears on every page you publish.
This guide uses Pixexl's assistant as the example, but the steps are the same for most chat tools that give you a script tag.
Before you start
You'll need four things:
- A plan with custom code. Webflow locks the custom code fields on free sites. A paid site plan (or, on some accounts, a paid workspace plan) unlocks them.
- Access to the site's settings, as its owner or a workspace member who can edit site settings.
- Your chat's embed code. In Pixexl, it's on your project's Settings tab, under the integration code. It looks something like this:
<script
src="https://…/pixe-widget.js"
data-project-id="your-project-id"
data-api="https://…"
async
></script>
- Your domains added to the project. For security, the chat only runs on domains you've allowed. Add your custom domain and, to test before you go live, your
yoursite.webflow.ioaddress.
It's also worth giving the assistant something to answer from first: add your site's pages as its knowledge (see What to give your AI assistant so it answers well).
Add the code in your site settings
- In your Webflow dashboard, open the site's Site settings.
- Go to the Custom code tab.
- Paste your embed code into Footer code (the box for code "before
</body>tag"). - Choose Save changes.
- Publish the site. Custom code only reaches visitors with the next publish.
Open your published site in a new tab and the chat button should appear in the corner.
Test on webflow.io first
Webflow lets you publish to your webflow.io address and your custom domain separately. To try the chat before your visitors see it, add the webflow.io address to the project's allowed domains, publish to that address only, and check it there. When you're happy, publish to your custom domain too.
Footer code or an Embed element?
Webflow's Embed element can hold code too, but only on the page where you place it (or in a component you'd need to add to every page). The site-wide footer code is set once and covers every page, including CMS template pages and pages you add later, so use that. If you want the chat on only a few pages, use each page's own custom code in its page settings instead.
Will it clash with my design?
It shouldn't. The chat draws itself in its own sealed-off area of the page, so your site's classes and interactions can't change how it looks, and its styles can't leak into your design. Its colours, greeting and position come from the Widget tab in your Pixexl dashboard. If you have a fixed element in a bottom corner, a cookie bar or a "back to top" button, move the chat to the other corner there.
Cookie consent
The chat remembers a visitor's conversation in their browser, so it's covered by your cookie rules. Either keep the chat's own cookie notice (on by default, linked to your privacy policy from the Widget tab), or, if you run a consent tool, turn the chat's notice off, add data-consent="pending" to the script tag and have your consent tool call PixeWidget.grantConsent() when the visitor agrees. Pick one, not both.
It's not showing up: what to check
- You haven't published. Saving the custom code isn't enough; publish the site.
- You're in the Designer or preview. Open the published address.
- The custom code fields are locked. Your plan doesn't include custom code.
- The domain. The address you're looking at,
webflow.ioor custom, must be in the project's allowed domains. - The chat is switched off. Check that "Show the chat on my site" is on in the Widget tab.
- A typo in the code. Copy the embed code again from the Settings tab rather than retyping it.
If it still won't appear, open your browser's developer console (right-click, Inspect, then Console). The chat leaves a short message there explaining why it didn't load.
After it's live
Ask it the questions your customers ask, read the real conversations once a week, and add forms so a question can turn into a booking or an enquiry without leaving the chat (see How to turn website chats into bookings and enquiries).
Every Pixexl plan includes the assistant, and your first 2 weeks are free, so you can try it on your Webflow site with real visitors before you decide. Meet Pixe AI to see what it can do.
Webflow chatbot questions
Which Webflow plan do I need to add a chatbot?
Custom code needs a paid plan. Depending on how your account is set up, that's a paid site plan or a paid workspace plan; if the Custom code fields are locked in your site settings, your plan doesn't include them.
Should I use footer code or an Embed element?
Footer code, in the site settings. It adds the chat to every page at once. An Embed element only adds it where you place it, and a Webflow Embed is limited in length and runs only on that page.
Why doesn't the chat show in the Designer?
Custom code only runs on the published site, not in the Designer or its preview. Publish, then open your live address or your webflow.io address.
Can I test it on my webflow.io address first?
Yes. Add your yoursite.webflow.io address to the project's allowed domains, publish to that address only, and check the chat there before you publish to your custom domain.
Is there a free trial?
Yes. Every Pixexl plan includes the AI chat assistant, and your first 2 weeks are free, so you can try it on your Webflow site with real visitors. See pricing for the plans.