Live chat on your website is one of the fastest ways to lift conversion: a visitor with a question gets an answer without leaving the page. But "add live chat to your website" isn't one button — it's a choice among several approaches, each with its own consequences for layout, speed, and privacy. Let's work out how not to get it wrong, and what to look at before dropping someone else's script into your site.
This isn't purely a technical question. A poorly embedded chat can slow your site down, break your mobile layout, or hand a third-party service more data about your visitors than it needs. A well embedded one sells and stays out of the way.
Why add live chat to your website
Customers rarely read an entire site looking for the answer to a simple question — it's easier to just ask. If there's no one to ask, they either go looking elsewhere (often at a competitor) or close the tab. Live chat on your website closes that gap: the question and the answer happen in the same place and moment the doubt appeared.
This matters most on pricing pages, checkout, or with a complex product — that's exactly where people tend to have one last question before they either buy or leave. A fast answer at the right moment sometimes matters more than any ad.
Three ways to embed chat
Technically, "adding chat" can be done in at least three ways, and the choice affects everything from layout to what data the third-party service can see.
- iframe. The chat lives in a separate frame, fully isolated from your page. Plus — it breaks nothing: your site's styles and the chat's styles never intersect. Minus — it's harder to pass context (say, a signed-in user's data) and style the widget to match your brand, since an iframe is opaque to the parent page by design.
- A script that injects elements straight into the DOM. Flexible: the chat can look like a native part of the site, fully under your design. Risky: foreign CSS classes can accidentally clash with your styles, and vice versa — your global CSS can break the chat. This is a common reason a "simply embedded" chat suddenly drifts out of layout after a theme update.
- Shadow DOM. The sweet spot: the widget embeds right into your page (so it can receive context and open/close easily), but its internal styles are isolated inside a shadow tree and don't leak either way. For the technical details, see the article on embedding a widget in a SPA.
If you have your own dev team and chat is part of the product rather than a one-off integration, it's also worth looking at the provider's public API: it lets you build your own chat interface on top of ready-made ticket logic. More in the article on the support API.
What to watch: performance
The most common harm from chat is slowing your site down. A heavy widget that drags in megabytes of scripts and blocks page load costs you the very customers it was meant to help keep — people close slow pages faster than they can read the first paragraph. Key things to check before you turn it on:
- Lazy init. The widget should load after the page's main content, not alongside it, and certainly not before it.
- A minimal loader. A tiny script (a few kilobytes) loads first, and the heavy part — HTML, CSS, chat logic — only when the user actually opens the chat window.
- No render blocking of the main page: adding chat shouldn't delay the main content's display by even a second.
- One line of code instead of a pile of tags — fewer chances to mix something up or forget to close a tag.
A simple way to check a chat before shipping it: open your browser's dev tools, the Network tab, and see exactly how much the chat script weighs and how many requests it makes on first page load — before the user has clicked anything.
What to watch: privacy and security
Chat on your site is a third-party entry point, so look at what data it collects and where it sends it. A good widget passes only what you explicitly specify (say, the name and email of a signed-in user), pulls in no extra trackers "just in case," and is clearly isolated from the rest of the page so it has no technical way to read other data — forms, cookies, local storage belonging to other parts of the site.
Check at least three things: whether the provider has a public data policy, whether you can limit exactly which context fields get sent, and whether the connection between the widget and the server is encrypted. If there are no clear answers to these questions, that's a reason to look for another provider rather than hope it'll be fine.
What context to pass, and why
A separate reason to embed chat via a script or Shadow DOM rather than a bare iframe is the ability to pass user context. This isn't about tracking — it's basic things: name, email, plan, or the page someone wrote in from.
This directly affects reply quality. The agent (or the AI preparing a draft) doesn't need to ask "which plan are you on" — the context is already in the ticket. The customer feels like they reached a company, not filled out a form again. In setups with mixed channels — website, Telegram, API — context is exactly what keeps the conversation history from getting lost.
Don't forget response speed
A technically flawless chat is useless if nobody answers in it for hours. By adding chat you take on a silent obligation to react fast — we wrote about customer expectations across channels in the article on response time. Live chat is the most demanding channel: here people expect minutes, not hours, and silence feels sharper than in email.
If your team is small and genuinely can't sit by the chat all the time, it's more honest to show the expected response time up front than to create the impression of a "live" chat that nobody actually reads for hours.
Common mistakes when adding chat
Before flipping chat on in production, it's worth running through a short checklist — most problems repeat from site to site:
- Installing a heavy widget without lazy loading and then wondering why page speed dropped.
- Styling the chat so it covers checkout buttons or the mobile menu.
- Passing too much data into context "just in case," without checking whether it's actually needed.
- Turning chat on but not assigning anyone to answer it — the chat becomes visible but silent.
- Not testing chat on mobile — that's where layout breaks most often, from iframe quirks or style conflicts.
How it's done in Duck Float
The Duck Float chat widget installs with one line of code, runs on Shadow DOM (so it doesn't conflict with your site's styles), loads lazily via a lightweight loader, and can pass visitor context — name, email, plan. Every request from the widget lands in the same inbox as Telegram and the public API, with full history, statuses, and tags. On the single inbox, see the article on Telegram, widget and API.
When a new message arrives, AI prepares a draft reply in the customer's language based on your product description and the conversation history — the agent sees it in the reply field and accepts it with Tab, edits it, or writes their own. Nothing is sent to the customer automatically. More on this approach in the article on AI drafts for support.
Duck Float is free during the beta. Want to see how it works on a live site — message us through the widget on this site (yes, that's the one).
