> ## 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 Wix site

> Embed your Chatbase AI agent on a Wix website using the website widget embed code

You can add your Chatbase AI agent to a Wix website by pasting the Chatbase **Website widget** script into Wix's **Custom Code** settings. Once the code loads, a floating Chat Bubble appears in the bottom corner of your site and opens the chat when visitors click it. The Chat Bubble is included on every Chatbase plan.

> [card] What you can do:
>
> Put your AI agent in front of every visitor to your Wix site, answering questions without them leaving the page.

## Before you start

* A Chatbase account with an AI agent. If you haven't built one yet, [sign up and start a 7-day free trial](https://www.chatbase.co/auth/signup) and follow [Your first AI agent](https://chatbase.co/docs/user-guides/quick-start/your-first-agent.md).
* A Wix website you can edit.

## How to embed your AI agent

**1. Copy your embed code**

1. Navigate to your [dashboard](https://www.chatbase.co/dashboard/) and select the AI agent you wish to embed.
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** and select the **Website widget** embed type. Scroll down and click **Copy** to copy the provided script.

![The Deploy step showing the website widget embed code](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)

**2. Open your Wix site editor**

Sign in to Wix and head to your dashboard. Click **Design Site** in the top-right corner of the page to load your site in the Wix editor.

![The Design Site button in the Wix dashboard](https://mintcdn.com/chatbase/JnjROJ-aB2q57UGe/user-guides/integrations/images/wix/wix-4.png?fit=max\&auto=format\&n=JnjROJ-aB2q57UGe\&q=85\&s=b11d6949ad5ebdeb75f2b5c4b7b5b713)

**3. Add the Custom Code element**

Scroll to the section of the website where you want the AI agent, then click the big plus (**Add Elements**) button on the left sidebar.

![The Add Elements button in the Wix site editor](https://mintcdn.com/chatbase/JnjROJ-aB2q57UGe/user-guides/integrations/images/wix/wix-5.png?fit=max\&auto=format\&n=JnjROJ-aB2q57UGe\&q=85\&s=ee8f87c6793c9b9841080f381d3f23f8)

Scroll down to locate and click **Embed Code**, then **Popular Embeds**, then **Custom Code**.

![Selecting Custom Code from the Wix embed options](https://mintcdn.com/chatbase/JnjROJ-aB2q57UGe/user-guides/integrations/images/wix/wix-6.png?fit=max\&auto=format\&n=JnjROJ-aB2q57UGe\&q=85\&s=b782d72d03f6284862130721ef6ccf27)

**4. Paste the embed code**

When the custom code widget pops up, click **+ Add Custom Code** in the top right, then:

1. Paste the code snippet into the custom code editor.
2. Provide a name for your code.
3. Choose an option under **Add Code to Pages**. Chatbase recommends loading the script on every page, so pick the option for all pages, such as **All pages**. To show the AI agent on some pages only, choose just those pages.
4. Choose where to place your code under **Place Code in**. The script belongs before the closing `</body>` tag, so pick the end of the body, such as **Body - end**.
5. Click **Apply**.

> [!TIP]
>
> Preview your website and confirm the floating Chatbase chat icon appears.

![The Chatbase Chat Bubble live on a Wix website](https://mintcdn.com/chatbase/JnjROJ-aB2q57UGe/user-guides/integrations/images/wix/wix-7.jpg?fit=max\&auto=format\&n=JnjROJ-aB2q57UGe\&q=85\&s=d285fea436a6c93da5e0be177b783404)

## Allow your Wix 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 Wix site runs on. For example (example values):

```text theme={null}
https://www.acme.com
https://jane.wixsite.com
```

Paths are ignored, so `https://jane.wixsite.com` covers every site under that address. Each entry matches one exact host, and an entry without `https://` or `http://` matches only https pages. Don't use `https://*.wixsite.com`: it would let every Wix site embed your AI agent. See [Deploy button](https://chatbase.co/docs/user-guides/chatbot/channels.md#deploy-button).

## Troubleshooting

> [accordion] The Chat Bubble doesn't appear on my 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 added with an Embed element on the page instead of through **Custom Code**. If Wix runs that element in its own frame, the bubble is clipped to the element's box.
>
> **Solution:** fix the matching setting, publish again, and reload the live site.

> [accordion] The Chat Bubble shows on desktop but not on mobile
>
> Chatbase's standard settings don't hide the Chat Bubble on mobile. The **Display** settings for mobile only change whether the chat opens on its own and whether floating messages show, not the bubble itself. Check that the custom code is set to load on the pages you're viewing on your phone, and check the causes above.

> [!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] Which Custom Code options should I pick in Wix?
>
> Load the code on all pages and place it at the end of the body. That matches Chatbase's instructions to add the script before the closing `</body>` tag on every page.

> [accordion] Can I put the AI agent on only one Wix page?
>
> Yes. Under **Add Code to Pages**, choose only the pages where the Chat Bubble should appear.

> [accordion] Why does the chat fill the whole screen on my phone?
>
> That's by design. On screens narrower than 640px, the chat opens full screen and the page behind it stops scrolling until the visitor closes it.

> [accordion] Can I move the Chat Bubble to the left side?
>
> Yes. Set **Position** to **Left** in **Display > Floating bubble**. Left or right is the only position option; there is no offset. See [Floating bubble](https://chatbase.co/docs/user-guides/chatbot/channels.md#floating-bubble).

## 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.