> ## Documentation Index
> Fetch the complete documentation index at: https://chatbase.co/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Add an AI agent to your Webflow site

> Add your Chatbase AI agent to a Webflow site as a floating Chat Bubble or as an inline iframe inside a container you control

You can add your Chatbase AI agent to a Webflow site in two ways: the **Website widget** script, which shows a floating Chat Bubble on every page, or the **Website iframe** code, which places the chat inline inside a Div you size in the Designer. Both work on every Chatbase plan, and both are copied from your Chatbase dashboard.

> [card] What you can do:
>
> Put your AI agent in front of every visitor to your Webflow site, as a floating Chat Bubble or sized and placed exactly where you want it.

## Before you start

* A Chatbase account with an AI agent. If you haven't built one yet, follow [Your first AI agent](https://chatbase.co/docs/user-guides/quick-start/your-first-agent.md).
* A Webflow site you can edit in the Designer.

## Choose an embed type

| | Website widget (recommended) | Website iframe |
| - | - | - |
| What visitors see | A floating Chat Bubble in the bottom corner of every page | The chat window embedded inline in a section of the page |
| Where the code goes | Site-wide custom code, before the closing `</body>` tag | An **Embed** element inside a Div on one page |
| Sizing | Automatic. Full screen on phones | You set the height on the Div |
| [Identity verification](https://chatbase.co/docs/developer-guides/website-integration/identity-verification.md) and [event listeners](https://chatbase.co/docs/developer-guides/website-integration/chatbot-event-listeners.md) | Supported | Not supported |

We recommend the **Website widget** script. Identity verification and event listeners only work through the Chat Bubble, and the script handles mobile layout for you. Use the iframe only when you want the chat to sit inside the page layout.

## Add the Chat Bubble to every page (recommended)

**1. Copy the Website widget script**

1. Go to the [dashboard](https://www.chatbase.co/dashboard/) of your Chatbase account and click your AI agent.
2. Click **Channels** in the left sidebar, then click **Manage** on the **Chat Bubble** card (or **Setup**, if you haven't configured it yet).
3. Click **Deploy**, select **Website widget**, and copy the script.

**2. Paste it into Webflow's site-wide custom code**

Open your site settings in Webflow and paste the script into the custom code field that is added before the closing `</body>` tag. Code placed there loads on every page, which is where Chatbase recommends putting the script. Webflow's own documentation on custom code shows where this field is.

**3. Publish your site**

Publish the site, then open the published URL and check that the Chat Bubble appears in the bottom corner.

## Embed the chat inline with an iframe

**1. Copy your embed code**

1. Go to the [dashboard](https://www.chatbase.co/dashboard/) of your Chatbase account.
2. Click the AI agent you wish to integrate into your Webflow website.
3. Click **Channels** in the left sidebar, then click **Manage** on the **Chat Bubble** card (or **Setup**, if you haven't configured it yet).
4. Click **Deploy** and select the **Website iframe** embed type. Click **Copy** to copy the provided HTML code.

![The Deploy step in the Chatbase dashboard](https://mintcdn.com/chatbase/DnMdgLj-7YGWYAcx/user-guides/integrations/images/Integrations/deploy-step.png?fit=max\&auto=format\&n=DnMdgLj-7YGWYAcx\&q=85\&s=31b0448df7dee6c3ccc65eaf9bb47879)

![Copying the iframe embed code](https://mintcdn.com/chatbase/DnMdgLj-7YGWYAcx/user-guides/integrations/images/Integrations/iframe-embed.png?fit=max\&auto=format\&n=DnMdgLj-7YGWYAcx\&q=85\&s=aea38c13c9ed5f73151a530d81fc1a05)

**2. Open your site in the Webflow Designer**

Log into Webflow and go to your dashboard. Hover over the site you want to add the AI agent to and click **Open Designer**.

![Opening a Webflow site in the Designer](https://mintcdn.com/chatbase/kU-6NVMb2BBkym9H/user-guides/integrations/images/webflow/webflow-4.png?fit=max\&auto=format\&n=kU-6NVMb2BBkym9H\&q=85\&s=cd6378ed137ad41c072812736e9a0e82)

Click the file icon (**Pages**) in the top-left corner and select the page you want to embed the AI agent on.

![Selecting a page in the Webflow Designer](https://mintcdn.com/chatbase/kU-6NVMb2BBkym9H/user-guides/integrations/images/webflow/webflow-5.png?fit=max\&auto=format\&n=kU-6NVMb2BBkym9H\&q=85\&s=2bcbb416bad4a995b5595fac62753347)

**3. Build a container for the widget**

A container keeps the iframe from spanning the entire width of the page and gives it a height. The iframe fills the width of its container, but its height doesn't adapt to the conversation, so the Div must set it.

1. Click the plus button (**Add elements**) in the top-left corner of the Designer.
2. Drag a **Section** element to the part of the page where you want the AI agent.
3. Drag a **Container** element onto the Section.
4. Drag a **Div** element onto the Container, and give it a fixed width and height so the AI agent stays contained.

![Building a Section, Container, and Div in the Webflow Designer](https://mintcdn.com/chatbase/kU-6NVMb2BBkym9H/user-guides/integrations/images/webflow/webflow-6.png?fit=max\&auto=format\&n=kU-6NVMb2BBkym9H\&q=85\&s=82b2a65aca954e3040343cf01da17de3)

**4. Add the Embed element and paste your code**

Scroll down the list of elements and drag the **Embed** element onto the Div you just added.

![Dragging the Embed element onto the Div in Webflow](https://mintcdn.com/chatbase/kU-6NVMb2BBkym9H/user-guides/integrations/images/webflow/webflow-7.png?fit=max\&auto=format\&n=kU-6NVMb2BBkym9H\&q=85\&s=3239e49fdeb4063522786801ac3bc4e7)

Double-click the Embed element to open the HTML editor, paste your Chatbase embed code, and click **Save & Close**.

![Pasting the embed code into the Webflow HTML editor](https://mintcdn.com/chatbase/kU-6NVMb2BBkym9H/user-guides/integrations/images/webflow/webflow-8.png?fit=max\&auto=format\&n=kU-6NVMb2BBkym9H\&q=85\&s=ea961278dcc7156a6a4515b970e1e3ae)

> [!TIP]
>
> You should see a preview of the AI agent on the live preview of your Webflow site, right inside the Designer.

![The Chatbase AI agent previewing inside the Webflow Designer](https://mintcdn.com/chatbase/kU-6NVMb2BBkym9H/user-guides/integrations/images/webflow/webflow-9.png?fit=max\&auto=format\&n=kU-6NVMb2BBkym9H\&q=85\&s=2ef514e68cf1b721cd392ee18fd63b81)

## Allow your webflow\.io address

If you turned on **Only allow embedding the agent on specific domains** in the **Specific domains** card of the **Deploy** sheet, list every address your Webflow site runs on, including the staging address. For example (example values):

```text theme={null}
https://www.acme.com
https://acme.webflow.io
```

Each entry matches only that exact host. `https://*.acme.com` matches subdomains of acme.com but not `acme.com` itself, and an entry without `https://` or `http://` matches only https pages. Avoid `https://*.webflow.io`: it works, but it lets every Webflow site embed your AI agent. See [Deploy button](https://chatbase.co/docs/user-guides/chatbot/channels.md#deploy-button).

## Troubleshooting

> [accordion] The embed or AI agent element is the wrong size
>
> **Possible cause:** the Embed element inherits its size from the Div you placed it in. The iframe code fills the width of the Div and has a minimum height of 700px, but it doesn't grow or shrink with the conversation.
>
> **Solution:** set an explicit height on the Div that wraps the Embed element. Webflow's [official documentation on the Embed element](https://university.webflow.com/lesson/custom-code-embed?topics=elements) covers embedding third-party tools in more detail.

> [accordion] The Chat Bubble doesn't appear on the published site
>
> **Possible causes:**
>
> * **Specific domains** is on and the address you're visiting isn't listed. The browser console shows a message starting with `[Chatbase] Agent` that says the agent is not allowed on that origin.
> * The visitor's country is in your [blocked countries](https://chatbase.co/docs/user-guides/chatbot/guardrails.md#blocking-a-country).
> * **Show to a percentage of visitors** is on under **Display > A/B testing**, and this visitor isn't in the sample.
> * The script was pasted into an Embed element instead of site-wide custom code. If the builder runs that element in its own frame, the bubble is clipped to the element's box.
>
> **Solution:** fix the matching setting, republish, and reload the published page.

> [!NOTE]
>
> You can customize the appearance and colors of your AI agent on your Chatbase dashboard. Go to your **dashboard**, choose an AI agent, click **Channels** in the left sidebar, click **Manage** on the **Chat Bubble** card, then open the **Display** tab to edit Content, Capabilities, Colors, Floating bubble, and Localization.

## Frequently asked questions

> [accordion] Should I use the script or the iframe on Webflow?
>
> Use the **Website widget** script unless you specifically want the chat inline. It's the only option that supports identity verification and event listeners, and it switches to full screen on phones automatically.

> [accordion] How do I size the iframe on mobile?
>
> The iframe takes the full width of its Div, but its height stays whatever the Div gives it, so pick a Div height that also fits a phone screen. The Chat Bubble doesn't need this: below 640px wide it opens full screen.

> [accordion] Can I move the Chat Bubble away from the corner?
>
> You can switch it between the bottom left and bottom right with **Position** in **Display > Floating bubble**. There is no offset setting, so it always sits at the bottom of the screen near the edge. See [Floating bubble](https://chatbase.co/docs/user-guides/chatbot/channels.md#floating-bubble).

> [accordion] Can I show the AI agent on some Webflow pages only?
>
> Yes. Instead of the site-wide custom code field, paste the script into the custom code of only the pages where the Chat Bubble should appear. For the iframe, add the Embed element only to those pages.

## Next steps

> [card] [Customize the Chat Bubble](https://chatbase.co/docs/user-guides/chatbot/channels.md#chat-bubble-display)
>
> Match the widget to your brand colors, position, and copy.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.