Advanced Features

Embed Chatbots On Websites

Put your AI agent on any website as a floating chat bubble or as a chat window inside a page. It takes three steps: allowlist your domain, copy the code, paste it on your site.

Before you start

  • An AI agent that has finished training. New here? Start with the Quick start.
  • Access to your site's HTML, or to your website builder's settings.

Where is your site?

Pick your install method: Shopify uses the Deploy button, WordPress uses the plugin, site builders and HTML sites paste the code after allowlisting the domain

Your siteHow to add the AI agentWhere the code goesGuide
ShopifyDeploy to Shopify storefront button. No code; your store domain is allowlisted for you.Whole storefront (theme app embed)Shopify
WordPressChat Data pluginEvery pageWordPress
WixWidget Bubble codeCustom Code; you choose the pagesWix
SquarespaceWidget Bubble codeCode Injection > header (whole site)Squarespace
WebflowIframe codeEmbed element on one pageWebflow
FramerWidget Bubble codePage Settings > Custom Code (one page)Framer
BubbleWidget Bubble codeHTML component on a pageBubble
WeeblyIframe codeEmbed Code element on a pageWeebly
Your own HTMLWidget Bubble or Iframe codeSee Paste the code belowThis page

On any platform except Shopify, follow the three steps below first. The platform guides then show exactly where to paste.

Step 1: allowlist your domain in Settings > Security. Step 2: copy the code from Embed on site. Step 3: paste it on your site, then check the bubble appears

Allowlist your domain

Your AI agent only loads on domains you allow. On any other domain the chat window shows an error instead.

  1. Open your AI agent and go to Settings > Security.
  2. Under Visibility, choose public. (private means only you can use the AI agent.)
  3. Turn on Embedding On Websites.
  4. In Allowed Embedding Domains, enter your site's domain, one per line, for example example.com. Subdomains such as www.example.com are covered by the same entry.
  5. Optional: in Disallowed Urls, list pages where the AI agent should not appear. Any URL that starts with an entry is excluded.
  6. Save your changes.

Settings > Security with Visibility set to public, Embedding On Websites turned on, a domain in Allowed Embedding Domains and a page in Disallowed Urls

Allow All Domains

The Allow All Domains toggle lets anyone embed your AI agent on any website. Leave it off unless you have a reason; untrusted sites could embed your agent.

Shortcut: if your AI agent is still private when you open Embed on site, it shows Public Access Required. Click Enable Public Access & Embedding to set it to public and turn on embedding. You still need to add your domain as above.

Copy the embed code

  1. In your AI agent's sidebar, click Embed on site.
  2. Pick a tab: Widget Bubble, Iframe or SDK (see the table below).
  3. Click Copy Code.

Embed on site panel opened from the sidebar, with the Widget Bubble, Iframe and SDK tabs and the Copy Code button

Widget BubbleIframeSDK
Looks likeA chat bubble in the bottom-left or bottom-right corner that opens a chat windowA chat window placed inside your page contentNot a new look: lets your site's code send data to and receive events from the embedded AI agent
Where it goesIn your site's HTML, usually in <head> or your builder's site-wide code areaIn the page body, exactly where the chat should showIn your site's HTML
Best forMost websites: the AI agent is one click away on every pageA dedicated help or contact pageDevelopers who need advanced customization. See Chat Data SDK.

Always copy the code from Embed on site. It contains your own chatbot ID. The widget code looks like this:

<script
src="https://www.chat-data.com/embed.min.js?chatbotId=YOUR_CHATBOT_ID"
defer>
</script>

Paste the code on your site

  • Widget Bubble: paste the script into the <head> of your pages. Most builders have a site-wide "custom code" or "header code" field for this, so you paste it once.
  • Iframe: paste the <iframe> code into the page body where the chat window should appear. By default it is full width and at least 600px tall.
  • Platform guides: see the table above for Shopify, WordPress and website builders.

Publish or save your site after pasting.

Check that it worked

Open your live site (not only the builder's preview) and look for the chat bubble or chat window. Send a test question.

What you seeFix
"Domain: … is not in the allowlisted domains of this chatbot"Add the domain named in the message to Allowed Embedding Domains. Builder previews often run on the builder's own domain, so test on your published site.
"Iframe Embedding is disabled for this chatbot"Turn on Embedding On Websites in Settings > Security.
Nothing appearsCheck that Visibility is public, the code is on the page you opened, the site is published, and the page isn't listed in Disallowed Urls.

Next step: change the bubble and chat window to match your brand in Customize the Chatbot Interface. Want to show someone how the agent will look on a site before you install it? Use the Website Embedding Simulator.

Frequently Asked Questions

How do I embed a Chat Data chatbot on a website?

The guide says the website setup starts by allowlisting your domain and making the chatbot public, then choosing one of two embed approaches: an iframe embed placed directly in the page HTML or a floating widget script that shows the chatbot as a bubble.

Why do I need to allowlist my website domain before embedding?

The main domain must be allowlisted so the chatbot is permitted to run on the production site. It also notes that you can block specific URL paths in the security settings if there are pages where you do not want the chatbot to appear.

What is the difference between the iframe embed and the widget embed?

According to the guide, the iframe script is used when you want to place the chatbot directly inside the HTML of a webpage as part of the page layout. The widget script is the alternative option for showing the chatbot as a floating bubble at the bottom of the website.

Where do I get the website embed code for my chatbot?

Click `Embed on site` in your chatbot's sidebar, pick the `Widget Bubble` or `Iframe` tab, and click `Copy Code`. The chatbot must be set to `public` visibility with embedding turned on for the code to work on your website.

Previous
Business Profile