Add Chat to Website HTML: Build Your Snippet, Choose Bubble or Inline, and Paste It in the Right Place

Add chat to website HTML pages and you skip plugins entirely: one script tag, pasted in the right spot, and the chat appears. This guide is for sites built from plain HTML files, templates or a static site generator. It explains where the tag belongs in the document and why, how to put it on fifty pages without pasting fifty times, how to place the chat inside a page instead of as a floating bubble, and gives you a builder that writes the snippet and inserts it into your page for you.

<script src=”https://livechatbot.in/widget.js” data-key=”YOUR_KEY” async></script>
<div id=”chat-box”></div>
<script src=”https://livechatbot.in/widget.js” data-key=”YOUR_KEY” data-mode=”inline” data-target=”#chat-box” data-height=”600″ async></script>

⚡ In short

  • Paste the script just before the closing body tag, once per page.
  • On a multi-page site, put it in a shared footer, include or layout file so every page gets it automatically.
  • For inline chat, add an empty div where the chat should sit and point data-target at its id.
  • Use the bubble script on most pages and the inline version only on the page with the box.
Add chat to website html in LiveChatBot: the chat widget on an online store answering a delivery question
How it looks in LiveChatBot: the chat widget on an online store answering a delivery question.

Where it goes

The right spot in an HTML document, and why

An HTML page has two main parts: the head, which holds information about the page, and the body, which holds what visitors see. The chat script can technically go in either, but the best place is at the very end of the body, just before the closing body tag.

Why the end of the body

Browsers read a page from top to bottom. A script near the bottom loads after your text, images and menus have started to appear, so visitors see your content first and the chat bubble a moment later. The async attribute on the tag also tells the browser not to wait for the chat, so your page never stalls because of it.

Why not inside a paragraph or section

The script doesn’t draw anything where it sits; it adds the chat to the page as a whole. Placing it inside a content block makes no visual difference, but it makes the tag easy to delete by accident when someone edits that section later.

One copy per page

If the tag appears twice on a page, only the first copy runs. A duplicate isn’t harmful, but two copies with different keys can show the wrong website’s chat. Keep exactly one.

The key ties it to your website

The data-key value tells the widget which website, settings and inbox to use. Each website in your account has its own key. Copy it from your dashboard rather than typing it.

Free tool

Build your snippet and insert it into a page

Choose bubble or inline, add your key, and optionally paste a page. The builder writes the snippet and puts it in the right place.