How to add an AI chatbot to a Bubble app

In the Bubble editor, go to Settings → SEO / metatags and paste the Feedbot script into Script in the body, then deploy. The chatbot appears on every page of your app; for a single page, put the script in an HTML element instead.

  • Setup: 10 minutes
  • Bubble paid plan for a live app on a custom domain
  • Free plan, no card
  • Updated

Bubble apps often have the same support questions over and over: how to reset a password, where a setting lives, what a plan includes. You can build a chat in Bubble with the API Connector, but a ready-made widget is quicker for that job. Here’s how to add Feedbot (our product).

What you need

  • A Feedbot bot id from Dashboard → Bot → Install (the Free plan works).
  • Edit access to the Bubble app.
  • For a live app on your own domain, a paid Bubble plan. See Bubble pricing for current plans as of October 2026.

Add the chatbot to every page

  1. Open your app in the Bubble editor.

  2. Click Settings in the left sidebar, then the SEO / metatags tab.

  3. Scroll to Script in the body and paste:

    <script src="https://w.feedbotai.com/v1/feedbot.js" data-bot-id="YOUR_BOT_ID" async></script>
  4. Click Preview to test in the development version. The chat button appears in the bottom-right corner.

  5. When it works, deploy to live.

Bubble inserts this field into the body of every page of the app, as described in the SEO / metatags manual. Use Script in the body, not Script/meta tags in header: the body is where widget scripts belong.

Add it to one page or a group of pages

Use an HTML element when you only want the chat in some places, for example inside the app but not on the landing page.

  1. Drag an HTML element onto the page (or into a reusable element such as your app header, so every page using it gets the chat).

  2. Make it small, for example 10 × 10 px. The widget draws its own floating button; the element is only a container for the code.

  3. Paste this snippet. It creates the script tag itself, which works reliably inside HTML elements:

    <script>
    if (!document.querySelector("script[data-bot-id]")) {
    var s = document.createElement("script");
    s.src = "https://w.feedbotai.com/v1/feedbot.js";
    s.async = true;
    s.dataset.botId = "YOUR_BOT_ID";
    document.body.appendChild(s);
    }
    </script>
  4. Preview the page and check the chat button.

Make sure the HTML element is visible on page load. If it’s hidden in a group that only appears later, the code runs later too.

Open the chat from a Bubble button

Bubble has no built-in “run JavaScript” action. Two options:

Method How
HTML button In an HTML element: <button onclick="Feedbot('open')">Chat with us</button>. Style it to match your app.
Plugin action With a plugin that runs JavaScript in workflows, run Feedbot('open') or Feedbot('sendMessage', 'I need help with billing').

Add the queue stub before your first call if the button could be clicked before the widget loads:

<script>
window.Feedbot = window.Feedbot || function () { (Feedbot.q = Feedbot.q || []).push(arguments) };
</script>

Full command list: JavaScript API.

Identify logged-in users

In an HTML element shown only when Current User is logged in, insert dynamic data for the user’s fields:

<script>
window.Feedbot = window.Feedbot || function () { (Feedbot.q = Feedbot.q || []).push(arguments) };
Feedbot("identify", {
userId: "Current User's unique id",
email: "Current User's email",
name: "Current User's name"
});
</script>

Replace each quoted placeholder with Bubble’s Insert dynamic data value. Without a hash the user is unverified: the bot sees the name and email, but chat history isn’t shared across devices. For verified users, compute HMAC-SHA256(identitySecret, userId) on a server you control and fetch it through the API Connector; keep the secret out of the page. Call Feedbot('reset') in your logout flow. See Identify users.

Troubleshooting

Symptom Cause Fix
Works in preview, not on live Not deployed Deploy the development version to live.
Requests rejected on one URL Domain missing from Allowed domains Add your custom domain and bubbleapps.io subdomain in Bot → Install → Allowed domains.
No button from the HTML element Element hidden or collapsed on load Make it visible on page load, and use the snippet that creates the script tag.
Button covers a Bubble floating group Both pinned to the bottom-right Add data-position="bottom-left", or change the position in the Feedbot dashboard.
Chat doesn’t appear in the editor canvas The editor doesn’t run page scripts Expected. Test with Preview.

Train it on your app’s help content

On Free, add text and FAQ in Bot → Knowledge. From Starter, import your help pages by URL or sitemap (pages that need JavaScript, like Bubble’s, are rendered in a real browser) and upload files. See knowledge base. When a user asks for a person, the bot hands off to you in Telegram, Slack, Discord or email (handoff).

Next steps

Questions

Can't find an answer? Ask the bot in the corner, or write to us.

Do I need a Bubble plugin to add a chatbot?

No. Feedbot installs with one script tag, which you paste into Bubble's Script in the body field or an HTML element. There's no Feedbot plugin in the Bubble marketplace, and you don't need one.

Where do I paste a script in Bubble?

For every page: Settings → SEO / metatags → Script in the body. For one page or a group of pages: an HTML element on the page or inside a reusable element such as your header.

Does the chatbot work on the Bubble free plan?

You can test it in your development version (the /version-test URL). A live app on your own domain needs a paid Bubble plan. Add each domain you use to Feedbot's Allowed domains list.

Can the chatbot know which Bubble user is logged in?

Yes. Insert Current User's unique id, email and name as dynamic data in an HTML element and call Feedbot('identify'). Without a server-side hash these users are unverified, which is fine for context but doesn't give chat history across devices.

Can I build an AI chatbot inside Bubble instead?

Yes, with the API Connector and a model API you can build your own chat UI in Bubble. It takes longer: you design the chat, store messages and handle your docs yourself. Embedding a ready-made widget is faster for support.

Keep exploring

Put one agent on your site today

Start on the free plan. Upgrade when conversations grow.