# Add an AI agent to your Bubble app > Add your QwryAI agent to a Bubble app with the Website widget code and an HTML element You can add your QwryAI agent to a Bubble.io app by pasting the **Website widget** code into an **HTML** element on your page. Once the code loads, a floating chat bubble appears in the bottom corner of the app and opens the chat when a user selects it. The chat bubble is included on every QwryAI plan. > [card] What you can do | /docs/user-guides/chatbot/channels | Answer every user of your Bubble app from a chat bubble, without them leaving the page. ## Before you start * A QwryAI account with an AI agent. If you haven't built one yet, follow [Build your first AI agent](/docs/user-guides/quick-start/your-first-agent). * A Bubble app you can edit. You can test in **Preview** on Bubble's free plan; Bubble needs a paid plan to deploy the app live. ## How to embed your AI agent **1. Open your agent's Chat bubble** In QwryAI, open the agent you want in your app, select **Channels** in the sidebar, then select **Manage** on the **Chat bubble** card. ![The Channels page with the Chat bubble, Help page and Center Stage cards, each with a Manage button, and the pointer on the Chat bubble card's Manage button.](annotated/01-channels.webp "Channels › Chat bubble › Manage.") **2. Open Deploy and choose Website widget** Select **Deploy** in the top-right corner of the Chat bubble editor, then select **Website widget**. ![The Deploy menu open under DEPLOY ON, listing Website widget, Website iframe, Shopify and WordPress, each with a one-line description.](annotated/02-deploy-menu.webp "Deploy lists every way to add your agent.") ![The Deploy menu with the pointer on Website widget (Embed a floating chat bubble on any website).](annotated/03-website-widget.webp "Website widget opens the Website bubble sheet.") **3. Copy the code** On the **Website bubble** sheet, select **Copy** under **Widget setup**. The code already points to your agent, so paste it exactly as copied. ![The Website bubble sheet with Send instructions via email, Copy prompt, the Specific domains toggle, and the Widget setup embed code with the pointer on Copy.](annotated/04-embed-code.webp "Copy the code under Widget setup.") **4. Open your page in the Bubble editor** Open your app in the Bubble editor, go to the **Design** tab, and pick the page that should show the chat bubble. **5. Add an HTML element** Under **Visual Elements**, drag **HTML** onto the page. Its size and position don't matter: the chat bubble always sits in the bottom corner of the screen. **6. Paste the code** * With the HTML element selected, open **Properties** and find **Content**. * Replace the placeholder in the **HTML** box with your QwryAI code. * Leave **Display as iFrame** off. In a frame, the chat bubble would be clipped to the element's box. The chat bubble shows on the canvas as soon as the code is pasted. ![The Bubble editor with an HTML element selected, the QwryAI code in its HTML box (its key shown as YOUR_EMBED_KEY), Display as iFrame off, and the chat bubble showing on the canvas.](builder/bubble-html-element.webp "The chat bubble appears on the canvas once the code is in.") > [!TIP] > > Select **Preview**, open the chat bubble and ask a question your agent should know. The conversation appears in your QwryAI **Inbox**. ![A Bubble app in Preview with the QwryAI chat window open, showing Hello! How can I help you today? and Powered by QwryAI.](builder/bubble-live.webp "The chat window open in the app's Preview.") ## Show the agent on every page of your app The HTML element only loads the code on the page it sits on. To show the chat bubble on several pages, put the HTML element in a reusable element that every one of those pages uses, such as a shared header. Once the code has loaded, the chat bubble belongs to the page itself, not to the HTML element, so the element can be small and sit anywhere in the header. ## Allow your bubbleapps.io address If you turned on **Specific domains** in the **Deploy** sheet, list each host your app runs on, one per line, then select **Save domains**. For example (example values): ```text https://acme.bubbleapps.io https://app.acme.com ``` ![The Specific domains toggle switched on with https://acme.bubbleapps.io and https://app.acme.com entered in the domain list, Enter each domain in a new line below it, and the pointer on Save domains.](annotated/06-specific-domains.webp "List each address, one per line, then Save domains.") Enter hosts without a path; QwryAI won't save an address with one. One `bubbleapps.io` entry covers both the development version (`/version-test`) and the live version of your app, and a custom domain needs its own entry. An entry without `https://` or `http://` is saved as `https://`. See [Channels](/docs/user-guides/chatbot/channels). ## Troubleshooting > [accordion] The chat bubble doesn't appear in Preview or on the live app > > **Possible causes:** > > * **Specific domains** is on and your app's host isn't listed. Your browser's developer console shows that the chat was blocked by the page's frame-ancestors policy. > * The visitor's country is in **Blocked countries** under [Guardrails › Country blocking](/docs/user-guides/chatbot/guardrails). > * **Visibility** is off on the Chat bubble's **Overview** tab. > * **Display as iFrame** is on for the HTML element. > > **Solution:** fix the matching setting and reload the app. > [!NOTE] > > You change how the chat looks in QwryAI, not in Bubble. Open **Channels**, select **Manage** on the **Chat bubble** card, then open the **Display** tab to edit **Content**, **Style**, **Floating bubble**, **Localization**, **Capabilities** and **Typography**. Select **Publish** to send your changes live; your app picks them up without new code. ## Frequently asked questions > [accordion] Does hiding the HTML element hide the chat bubble? > > Not once the code has run. The chat bubble is added to the page itself, outside the HTML element, so hiding or collapsing the element afterwards leaves it in place. Whether the code runs at all when the element starts hidden depends on how Bubble handles hidden elements. > [accordion] Do I need separate setups for version-test and live? > > No. Both versions use the same code. If you use **Specific domains**, one entry for your `bubbleapps.io` host covers both. > [accordion] How does the chat behave for users on phones? > > On screens narrower than 768px, the chat opens full screen until the user closes it. Its side of the screen comes from **Position** under **Display › Floating bubble**. > > ![The Chat bubble editor on the Display tab with the Floating bubble section open, showing Position with Left and Right options.](annotated/07-floating-bubble.webp "Position: Left or Right.") > [accordion] Can I pass the logged-in Bubble user to the agent? > > Yes. The chat bubble supports [identity verification](/docs/developer-guides/website-integration/identity-verification): your app signs a token for the signed-in user and passes it to the chat bubble, so your agent knows who it's talking to. The **Identity verification** section of the **Website bubble** sheet has the secret key and the code. ## Next steps > [card] Customize the chat bubble | /docs/user-guides/chatbot/channels | Match the chat bubble to your brand's colors, position and wording. > [card] Identity verification | /docs/developer-guides/website-integration/identity-verification | Tell your agent who your signed-in users are.