Add the HelpBat chat widget to your website
One script tag gives visitors live chat with typing indicators, file upload and an email fallback. Here is how to add it safely and make it yours.
The HelpBat chat widget is a launcher button that opens a chat window on your site. Visitors can ask a question, upload a file and see replies as they are typed. Every conversation becomes a ticket in the same inbox as email, so your team works one queue. When nobody is online, the conversation still becomes a ticket and the visitor is told the reply will come by email.
Adding it takes one line of code. Locking it down and making it look like your brand takes a few more minutes, and this tutorial covers both.
What you need
- A HelpBat help desk with a role that can change settings.
- Access to the HTML of your site, a tag manager, or the custom code setting of your site builder.
- The list of domains where the widget should appear, for example https://www.example.com.
Step by step
- Copy the snippet
Open Settings, Channels. The Chat widget card says Add this line before the closing body tag of your site and shows your snippet. It looks like this, with your own widget key:
<script src="https://helpbat.officebats.com/widget.js" data-key="wk_..." async></script>Press Copy.
- Paste it into your site
Paste the line just before
</body>on every page where chat should appear, or once in a shared layout or footer template. Theasyncattribute means it never blocks your page from loading. - Set the allowed sites
In the same card, fill in Allowed sites, one origin per line, such as
https://www.example.comor*.example.com. When the list is empty any site can load your widget, which is handy while testing but not recommended once you are live. The same allowlist protects your contact form endpoint. - Choose colour, greeting and offline message
Set the Colour of the launcher, a Greeting visitors see when they open the chat, and the text for When nobody is online. Keep the greeting short and specific, for example "Questions about an order? We usually reply within minutes on weekdays."
- Decide on the pre chat form
The pre chat form asks for a name, an email and the question. Leave Ask for an email before the chat starts on if you want to be able to reply after the visitor leaves; this is the default. Press Save.
- Test with the demo page
Use the demo link next to the Save button to open a test page with your widget. Start a chat, then answer it from the inbox. Try closing the visitor tab and replying again: the reply is emailed to the address from the pre chat form.
What visitors and agents see
| Visitors get | Agents get |
|---|---|
| A launcher in your brand colour | Chats in the inbox on the chat channel |
| A pre chat form with name, email and question | The pages the visitor viewed on your site |
| Live replies with typing indicators both ways | Whether the visitor is still on the site, and when they are typing |
| File upload, with the same types and sizes as email | Replies that go out at once, with no undo window |
| Links to your help center | Email delivery of the reply if the visitor has left |
Let the AI agent answer first
On Pro and above you can turn on the AI agent for chat in Settings, AI: check Let the AI agent answer first, set the Confidence threshold (percent) and choose the chat channel. It answers only from your published public articles. It hands off to a person when it is not confident enough, when the visitor asks for a person, or after two answers that did not solve it. Each handoff adds an internal note with the reason, so the agent who picks it up does not have to ask the customer to repeat themselves.
Before turning it on, write articles for your most common questions. Read AI customer service agents and per resolution pricing compared to see how this compares with tools that charge for every AI answer.
Prefer a contact form?
If you do not want live chat on a page, you can post a contact form from your site to /api/forms/<widget key> with email, name, subject and message fields. Add a hidden, empty field named website as a honeypot against bots. Each brand's help center also has a request form at /hc/<brand>/new. See Forms and channel apps.
Troubleshooting
The launcher does not appear
Check that the script tag is on the page and that your site's origin is listed in Allowed sites exactly, including https and any www. A strict content security policy on your site must allow scripts and connections to helpbat.officebats.com.
Chats arrive without an email
Turn on Ask for an email before the chat starts, so you can always reply by email if the visitor leaves.
The widget shows on the wrong site
Someone copied your snippet. Fill in Allowed sites; once the list has entries, other origins cannot use your widget key.
Frequently asked questions
Does the chat widget slow down my site?
The script loads with the async attribute, so it does not block your page from rendering.
Can I use one widget on several domains?
Yes. List every origin in Allowed sites, one per line, or use a wildcard such as *.example.com.
What happens outside business hours?
The conversation still becomes a ticket, the visitor sees your offline message and is told the reply comes by email, and your team answers it from the inbox.
Is the AI agent required?
No. It is off until you turn it on, and you choose the channels and the confidence threshold.