Threadline

Connecting the Website Widget No dashboard needed

The website widget is the odd one out among Threadline's channels: there's no third-party developer account, no app review, and no dashboard to configure anywhere else — everything happens inside Threadline's own admin panel, and the only thing you paste elsewhere is a single line of HTML on your own site.

In plain words

What this is. A chat bubble in the corner of your own website. Visitors click it and chat with your AI, without leaving your site and without installing anything.

The problem it solves. Many visitors have a quick question and leave if they cannot ask it. Not everyone wants to open WhatsApp or give a phone number. The widget lets them ask right there.

How it works. You paste one line of code into your website. That line loads the chat bubble. Messages go to the same Inbox as all your other channels.

How long it takes. About 5 minutes, if you can edit your website.

For what a channel is and how to manage one afterwards, see Channels.

1. Create the channel in Threadline

  1. In Threadline, go to Channels → Add channel.
  2. Choose Website widget, give it a name (e.g. "Website Chat").
  3. Optionally choose an assistant now, or do it later from the channel's card — no credentials are required, so this is the shortest of every channel's setup.
  4. Save.

2. Copy the embed snippet

On the new channel's page, Threadline shows an embed snippet that looks like this:

<script src="https://yourdomain.com/widget.js" data-channel="7" async></script>

Paste it just before the closing </body> tag on every page of your site where you want the chat bubble to appear — a shared footer/layout template is the usual place if your site has one, so you only add it once.

  • data-channel is this channel's own ID — copy it exactly as shown, don't reuse another channel's snippet.
  • The script is loaded with async and adds nothing to your page until it finishes loading, so it won't block your site's own rendering.
  • Widget language. The bubble's buttons show in each visitor's browser language. To fix one language instead, choose it under Widget language above the snippet; the snippet then gets a data-lang attribute (for example data-lang="es"). The AI always answers in the language the visitor writes in.

3. Test it

Open your site in a normal (or incognito) browser tab. A round chat launcher button appears in the bottom-right corner. Click it, send a message, and it should appear in Threadline's Inbox within a few seconds and, if a knowledge base is linked, get an AI reply within about 5 seconds — the widget checks for new replies on a short poll, not instantly.

If nothing arrives, check Settings → System for a stale-cron warning first, then see Troubleshooting & FAQ.

Buttons in the chat

When an automation sends quick replies, a list or a link button, the chat shows them as buttons under the message. A visitor taps one and the chosen words are sent as their reply. A link button opens the page in a new tab.

How visitor sessions work

A visitor never logs in or signs up. The widget generates a random session ID the first time it loads and stores it in the browser's localStorage, then reuses that same ID on every later visit from the same browser — so a returning visitor sees their previous conversation continue, but a different browser or device always starts a brand-new one. Clearing site data or browsing in a private window also starts a new conversation, since there's nowhere for the session ID to persist.

Recognising a visitor across devices

Once Threadline learns a visitor's email address, it can join up their conversations from different browsers and devices. There are two ways it learns it:

  • From a lead form. When a visitor answers an Email field in a lead form with a valid address, they're identified automatically — nothing to set up.

  • From your own site. If your visitors log in to your website, you already know their email. After the embed snippet, call:

    window.ChatWidget &&
       window.ChatWidget.identify('visitor@example.com');
    

    with the signed-in user's real email (your site's template fills it in). The channel page shows this line under Optional: identify a known visitor. Older pages that call window.ThreadlineWidget keep working. Because the widget loads async, run it after the page has loaded (e.g. on window's load event); if the widget isn't ready yet, the call simply does nothing.

When the same email turns up in a new session, Threadline moves the visitor's earlier conversations, lead form answers, and broadcast history onto the current session, so the chat window shows their full history and your Inbox shows one customer instead of two. Matching is per channel — the same email on two different widget channels stays two separate customers.

Only pass an email you've actually verified (such as your logged-in user's own address). Anyone who calls identify() with an email takes over that email's widget history in their browser.

Every widget conversation appears in the same admin Inbox as WhatsApp, Telegram, Instagram, and Messenger conversations — there's nothing separate to check.

Widget not appearing at all? A strict Content-Security-Policy (CSP) header on your site can silently block the widget's <script> tag or its requests back to Threadline. See Troubleshooting for what to add to your CSP.