HTML chatbot
Add an AI Chatbot to Any Website with One Line of HTML
To add a chatbot to a website you can edit, create a free Ethora agent, copy its one-line script and paste it into your page's HTML just before the closing body tag. Setup takes about 15 minutes, and the paste itself takes one. The chatbot then answers visitors from your own pages and documents.

AI chatbot for your website HTML
What you need to embed a chatbot in a website
This guide belongs to the AI chatbot for your website page, which covers what the widget does and how it looks. Here we cover one thing: where its code goes on a site you edit yourself.
- An Ethora account on the free plan: $0, no credit card, 1,000 monthly active users and all chat and AI features.
- The address of your website, plus any PDF or other documents you want the chatbot to answer from.
- Access to your site's HTML files, or to a footer or custom code field in whatever you use to manage the site.
- A way to put the changed file live: FTP, your host's file manager or your usual deploy.
- About 15 minutes. No coding: you copy one line and paste it.
On WordPress, skip the manual paste and install the Ethora WordPress plugin. On a hosted builder, use the guide for Squarespace, Webflow, Wix or Shopify.
Step by step
Add the chatbot in five steps
Steps 1 to 3 happen in the Ethora admin panel, step 4 in your page's HTML, and step 5 on your live site.
Sign up free and create an agent
Create an Ethora account on the free plan: $0, no credit card. In the admin panel, create your agent from a template and give it a name, a greeting and a few lines of instructions. The no-code AI agent builder walks you through it.
Add your content and test it
Enter the address of your website and Ethora crawls its pages, then crawls them again on a schedule. Upload PDF and other documents for anything the pages do not cover. Ask real questions in the test chat, which shows the sources behind each answer.
Copy the one-line script
In the Ethora admin panel, open your app's AI Widget settings. Under Website widget, the Code tab shows the script with your app ID filled in. Copy it from there.
Paste it before the closing body tag
Open your page's HTML file, find the closing
</body>tag near the end and paste the script on the line above it. If your pages share a footer or layout file, paste it there once so that every page gets it. Full steps below.Publish and check
Upload or deploy the changed file, then load the page in your browser and look for the chat launcher in the corner. To change the theme, colours, launcher or position, use the Ethora admin: it has seven themes and a live preview, and saved changes reach your site within about a minute without pasting the code again.
Where to embed the chatbot code in your HTML
The script is an ordinary HTML script tag. It goes at the end of the page body, on every page where the chatbot should appear.
<script
src="https://widget.chat.ethora.com/assistant.js"
data-app-id="YOUR_APP_ID"
></script>
</body>
</html>
This is a short example with a placeholder. Copy the exact code from your admin panel: in AI Widget settings it comes with your own app ID in place of YOUR_APP_ID, and it may carry more attributes than the example. Paste it as it is.
- Open your page's HTML file in a text or code editor. On a single page site this is usually
index.html. - Go to the end of the file and find the closing
</body>tag. - Paste the Ethora script on its own line, directly above it.
- If the site has several pages, do the same in each one, or paste the script once into the shared footer or layout file that all pages include.
- Save the file and upload or deploy it to your host as you normally do.
The data-app-id value is the ID of your Ethora app, so the line is different for every account. Use the one from your own admin panel and do not retype it by hand.
Source for these steps: MDN Web Docs, "The script element", checked in December 2026. Menus change: if a label on your screen differs, follow the current version of that article.
Troubleshooting
Widget not showing on your site? Check these
Go through them in order, from the most basic cause down.
The script is on one page only
A script in one HTML file loads on that page and nowhere else. Add it to every page, or to the footer or layout file they share.
The changed file never reached the server
Saving the file on your computer does not change the live site. Upload or deploy it, then open the live page, view its source and search for assistant.js.
A cached copy of the page
Your browser, your host or a CDN in front of the site may still serve the old page. Reload with a hard refresh, try a private window, and clear the host or CDN cache if you use one.
Your editor changed the script tag
Some site editors and content fields strip or rewrite script tags. Paste the code in a code view or in a field meant for scripts, and check that the page source shows the line exactly as you copied it.
A Content Security Policy blocks it
If your site sends a Content-Security-Policy header, scripts from other hosts are blocked unless the policy allows them. Allow widget.chat.ethora.com as a script source, then open the browser console, which names anything else the policy blocked.
The app ID is still the placeholder
The example on this page says YOUR_APP_ID. The code in AI Widget settings has your real app ID filled in, so copy it from there.
Good to know
Good to know about the script
What the one line does on your page, and what you never have to touch again.
It does not get in the way of your page
The script loads asynchronously, and the widget's styles are isolated in a Shadow DOM, so it does not clash with your site's CSS.
One paste, then everything in the admin
Seven themes, colours, the launcher and its position are set in the Ethora admin with a live preview. Saved changes reach your site within about a minute, without pasting the code again.
Site builders and content systems
Most site builders have a footer or custom code field that does the same job as editing the file. For Squarespace, Webflow, Wix and Shopify, follow the dedicated guides below. On WordPress, use the plugin.
More than answers
Flows add short conversations with buttons to the chat, from templates such as Appointment request, Lead capture and Feedback survey. Conversations are listed in the Ethora admin, and a person can join the same conversation.
Other platforms
Guides for other website builders
The Ethora side is the same everywhere. Only the place where you paste the line changes.
AI chatbot for Squarespace
Paste the script into the Footer field of Code Injection.
Squarespace guideAI chatbot for Webflow
Site settings, Custom code tab, Footer code, then publish.
Webflow guideAI chatbot for Wix
Settings, Custom Code, added to all pages at the end of the body.
Wix guideAI chatbot for Shopify
Edit code, theme.liquid, one line above the closing body tag.
Shopify guideWordPress plugin
On WordPress, install the Ethora plugin and skip the manual paste.
WordPress pluginAI chatbot for your website
What the widget does, how it looks and how it answers from your content.
The widget pageMore reading: AI chatbot for small business, how a RAG chatbot answers from your content, best AI chatbots for websites and AI agents on customer websites.
Adding a chatbot to a website: FAQ
Where exactly do I embed the chatbot code in the HTML?
At the end of the page body, on the line just above the closing body tag. Put it on every page where the chatbot should appear, or once in a footer or layout file that all your pages share.
Do I need to know how to code?
No. The agent is built in the admin panel without code, and adding it to the site is one copy and paste. You only need to be able to edit your page's HTML or reach a custom code field.
Will an HTML chatbot slow my page down?
The script loads asynchronously, so the page does not wait for it. Its styles are isolated in a Shadow DOM, so it does not clash with your site's CSS either.
Is it free to add a chatbot to a website?
With Ethora you can start on the free plan: $0, no credit card, 1,000 monthly active users and all chat and AI features. See pricing for the paid plans.
Does the same code work on WordPress, Shopify or Wix?
It is the same script everywhere; only the place you paste it differs. See the guides for Shopify, Wix, Squarespace and Webflow. On WordPress, the Ethora WordPress plugin adds it for you.
Put an AI chatbot on your website today
Free plan, no credit card, about 15 minutes to set up. If you would rather talk it through first, book a short call with our team.