Pluspoint — AI local marketing platform

Live chat on your website

Updated October 21, 2026

The snippet from the channel’s Widget code tab is all a website needs: paste it once and the chat button, the welcome message and the contact form appear on every page. This article is for sites that want more — open the chat from their own buttons, follow it in their analytics, let customers who are already signed in skip the form, or limit where the widget appears. Everything here is optional; a site that changes nothing keeps working as it does today.

Before you start

  • A live chat channel with its snippet on the site — see Live chat channel.
  • Someone who can edit the website’s HTML. Letting signed-in customers skip the form also needs a small change on your own server.
  • Account Settings set to Full, or the account owner role, to open the channel’s Widget code tab.

Where to find it

Settings → Channels → the edit icon on the Live-chat row → Widget code tab, or go to https://app.pluspoint.io/account-settings/channels.

Open the chat from your own button

Copy the snippet from the Widget code tab. Besides loading the widget, it defines a pluspoint function your page can call from anywhere, even before the widget has finished loading: calls made early run as soon as it is ready. With your own channel id in place of the Xs it looks like this:

<!-- Pluspoint script -->
    <script>window.pluspoint=window.pluspoint||function(){(window.pluspoint.q=window.pluspoint.q||[]).push(arguments)};"loading"!==document.readyState?init():document.addEventListener("DOMContentLoaded",init);function init(){var t=document.createElement("script");t.id="pl-chat-widget",t.dataset.channelid="XXXXXXXXXX",t.src="https://app.pluspoint.io/widget/pl.widget.chat.min.js",document.getElementsByTagName("body")[0].appendChild(t)}</script>
<!-- End of Pluspoint script -->

A snippet copied before the window.pluspoint= part existed still shows the chat, but pluspoint(...) is not defined on that page. Copy it again once.

Then call pluspoint('open') from any element on the page:

<button onclick="pluspoint('open')">Chat with us</button>
CommandWhat it does
pluspoint('open')Opens the chat window.
pluspoint('close')Closes the chat window; the chat button stays.
pluspoint('setLocation', '123')Assigns the conversation to that location and skips the location question. Use the same ID the chat link takes in ?locationId=.
pluspoint('setLanguage', 'ES')Switches the chat to that language: GB, UA, PT, ES, PL, DE, BR, FR, RU or MX. The welcome and offline messages come from the channel’s Messages tab, so add that language there too.
pluspoint('identify', {…})Hands over a signed-in customer’s details so the form can be skipped — see below.
pluspoint('forget')Drops those details and the conversation in that browser — see below.

setLocation and identify shape the next conversation. A conversation already open in that browser keeps its location and its contact; when testing, use a page where you have not chatted yet or a private browser window.

Follow the chat in your analytics

Register a handler with pluspoint('on', event, handler). It receives one argument, { type: 'opened' } for example, so one handler can serve several events:

<script>
  pluspoint('on', 'firstMessageSent', function (event) {
    gtag('event', 'live_chat_' + event.type);
  });
</script>
EventWhen it fires
openedThe chat window opens, from the chat button or from pluspoint('open').
closedThe chat window closes.
firstMessageSentThe visitor’s first message is through and the conversation exists in your Inbox.
conversationResolvedThe conversation is resolved while the visitor still has the page open.

Events carry no contact details and no message text — only the event type. pluspoint('off', 'firstMessageSent', handler) stops a handler you registered.

Let signed-in customers skip the form

When your site already knows who the visitor is, it can hand their details to the chat. The visitor then writes and the conversation starts — no form — as long as every detail the channel requires was handed over. When something is missing, say the chat requires a phone number and your site only knows the email, the form shows only the missing fields. Sex and date of birth cannot be handed over, so a chat that requires them asks for them. When you hand over a customer ID, email or phone, it asks only the first time in each browser. Handed-over details are never shown back to the visitor, and the Inbox shows them exactly as if the visitor had typed them; there is no verified mark.

  1. On the Widget code tab, under Signed-in customers, copy the secret. Anyone who can edit the channel can copy or replace it. Keep it on your server and never put it in the page.

  2. On your server, when serving a page to a signed-in customer, join the customer’s details into one string — customerId, name, email, phone and timestamp, in that order, separated by line breaks, with an empty line for a detail you do not send — and sign it with HMAC-SHA256 using the secret, hex encoded. The timestamp is the current time in unix seconds, and the signature is valid for 15 minutes, so generate it when the page is served, not at build time or from a cache.

    const crypto = require('crypto');
    
    function signChatVisitor(customer) {
      const timestamp = Math.floor(Date.now() / 1000);
      const details = {
        customerId: customer.id,
        name: customer.fullName,
        email: customer.email,
        phone: customer.phone,
      };
      const canonical = [details.customerId, details.name, details.email, details.phone, timestamp]
        .map((value) => value ?? '')
        .join('\n');
      const signature = crypto
        .createHmac('sha256', process.env.PLUSPOINT_CHAT_SECRET)
        .update(canonical)
        .digest('hex');
      return { ...details, timestamp, signature };
    }
  3. Put the result in the page and hand it over:

    <script>
      pluspoint('identify', {
        customerId: '48213',
        name: 'Ana Souza',
        email: 'ana@example.com',
        phone: '+5511999990000',
        timestamp: 1792540800,
        signature: '3b9f2c…'
      });
    </script>
  4. When the customer signs out, call pluspoint('forget'). It drops the handed-over details and the conversation held in that browser, so the next person on a shared computer starts fresh. Call it on sign-out only, not on every page load.

Send the strings exactly as you signed them: a trimmed name or a reformatted phone number makes the signature invalid. Every detail is optional, but at least one must be present. customerId is your own stable identifier for the customer, so all their chats land on one contact. Phone numbers go in international format, such as +5511999990000.

To greet a customer handed over with a name by their first name, write [name|there] in the welcome message on the channel’s Messages tab. Visitors without a handed-over name read there instead.

A conversation already open in that browser is not changed by identify: it keeps the contact it started with, and the details apply to the next one. When identify hands over a different customer from the last one in that browser, the conversation held there is dropped first, as with forget.

Select Replace secret when the secret may have leaked or when someone who had it leaves. Signatures made with the old secret stop working at once: pages still signing with it show the form again until your server uses the new one.

Limit the sites your chat appears on

On the Widget code tab, under Allowed sites, enter the domains the widget may appear on, up to 50. example.com covers example.com and every subdomain, such as www.example.com and shop.example.com; www.example.com covers that host only. With the list empty, the widget appears on any site that carries your snippet, as it does today.

Your microsites and the chat link always work, whatever the list says. On any other site the widget shows nothing at all — no chat button, no error — which is also what you see while testing from a staging domain or a local file you have not listed.

Troubleshooting

SymptomCauseFix
Your button does nothing, or the browser console says pluspoint is not definedThe snippet is missing from that page, it was copied before the window.pluspoint= part existed, or your call runs from a script placed before the snippet.Copy the snippet again from the Widget code tab and put it before any script that calls pluspoint.
The form still asks for details you handed overThe signature is older than 15 minutes (a cached page, or a server clock that is off), it was made with a different secret, or a detail was sent but not signed. A conversation already open in that browser also keeps its own contact.Generate the signature when the page is served, check the server’s clock, copy the secret again, and sign exactly the strings you send. Test in a private browser window; a rejected identify is reported in the browser console.
The widget is invisible on one of your sitesThat site is not in Allowed sites.Add its domain, or clear the list to allow any site.
setLocation or setLanguage has no visible effectA conversation is already open in that browser, so the location is kept; or the language code is not in the list above, which the browser console reports.Test in a private browser window and check the console.
After setLanguage the buttons change language but the welcome message does notThe channel’s Messages tab has no texts in that language.Add the language on the Messages tab.
Book your Pluspoint demo