How to set up live chat on your website
Live chat is the chat window on your own website. A visitor clicks the chat button, writes a message, and the conversation arrives in the operator workspace chat.smsbat.com, next to Viber, Telegram, Facebook and the other channels. Operators answer from the same place as for every other channel.
In the dashboard omni.smsbat.com the Live Chat page is where you create such widgets, configure how they look and behave, and copy the code to insert on the website. The product itself is described on the SMSBAT Widget page.
Live chat and operator widgets are different things
Live Chat is the widget for your website visitors. The Operator chat item in Integrations is a separate widget for your operators; it is described in Operator widgets.
Before you start
- An organization in SMSBAT Omni with operators. Chats from the widget go to the operators of the organization the widget belongs to, see How to create operators.
- Access to your website’s code, or a developer who can insert a script into the site.
- Working hours and after-hours replies are set per organization in Chat settings.
Where to find live chat
In the left menu open Channels → Live Chat. The page shows the list of your widgets with Name, Organization and guid (the widget’s unique code). Above the list are the Name search and the Organization filter.
The page is available to account owners and administrators; operators do not see the dashboard menu.
Step 1. Create a widget
-
Press Create.
-
Fill in the form:
Field What to enter Name A name to recognise the widget, for example the website address. Required. Organization The organization whose operators will receive the chats. Required. Is default chat activator visible On: the standard round chat button is shown on the site. Off: you open the chat with your own button. Draggable default chat activator Shown when the standard button is on. Lets visitors drag the button to another place on the screen. SMSBAT administrators also see a Client field.
-
Press Create. You see Successfully was created, and the widget appears in the list.
To copy the guid, press the copy icon next to it.
Step 2. Configure the widget
Click the widget in the list to open its settings. Press the pencil icon to switch to editing, change the settings and save. The settings are split into three tabs.
Main settings
| Setting | What it does |
|---|---|
| Name, Logo | The widget name and the logo shown in the chat window. |
| Is default chat activator visible | Shows or hides the standard chat button. |
| Draggable default chat activator | Lets visitors move the chat button. |
| Phone number verification | Asks the visitor to confirm a phone number. |
| Email address verification | Asks the visitor to confirm an email address. |
| Reaction after chat | Asks the visitor for a reaction after the conversation. |
| Show widget close icon | Shows a close icon in the chat window. |
| Dark theme | Turns on a separate set of colours for the dark theme. |
| Show social icons list on click | On: social icons appear after the visitor presses the “Share” button. Off: they are shown right away. |
| Show social icons list after clicking on chat activation button | Shows the social icons when the visitor presses the chat button. |
Social media list. Press Add social link, choose the network (Email, Viber, Telegram, Whatsapp, Rozetka, Facebook or Instagram), pick an icon in Choose icon, enter the Url and press Add social link again. Visitors can then continue the conversation in the messenger they prefer. Each network can be added once.
Light theme and Dark theme. For each theme set the Main color, Icon color, Operator message color and Operator message text color.
Press Show preview to see the widget. As the hint says, Save changes to see updated preview.
User settings
Chat view sets what a visitor sees:
- Single chat — one conversation;
- Chats list — the list of the visitor’s conversations.
This tab also contains the instruction How to authorize a user with a JWT token? for developers. If your website passes the signed-in user’s token to the widget, the widget opens that user’s own chats; without a token, a new chat is created as usual.
Translations
- Locales — the languages of the widget. As the hint says, the locale must match the language in the
langattribute of your page’shtmltag. - Translations — the texts of the widget in each language, including the welcome message. If the welcome message translations are empty, the welcome block is not shown.
Step 3. Put the widget on your website
- On the Main settings tab find the code blocks ES6 and ES5.
- Copy the ES6 code with the copy button. The ES5 variant is for websites that need the older JavaScript format; it consists of two code pieces, copy both.
- Insert the code into the HTML of every page where the chat should appear, or send it to your developer.
- Open your website and check that the chat button appears.
The same tab explains two optional script attributes for developers:
- How change the widget theme? — the widget follows the
themeattribute of its script tag; set it todarkorlightto switch the theme. - How set default email address the widget theme? — add the
emailattribute with a valid address to set the default address for notifications.
Step 4. Answer visitors
Write a test message in the chat on your website. It arrives in chat.smsbat.com for the operators of the widget’s organization. To see only website chats, choose Widgets in the Chat type filter.
Website chats are always started by the visitor; an operator cannot start a new chat in this channel. How to take and answer chats is described in How to handle a conversation.
Common questions
The chat button does not appear on my website. Check that the code was inserted on the page and that Is default chat activator visible is on. If you turned it off, the chat opens only with your own button.
I changed the colours, but the preview did not change. Save the changes first, then press Show preview again.
Messages from the website do not reach operators. Check which organization the widget belongs to and that this organization has active operators. In chat.smsbat.com, check the Chat type filter and other filters.
The widget shows the wrong language.
Check Locales on the Translations tab: the locale must match the lang attribute of the page’s html tag.
Can I have different widgets for different websites? Yes. Create a separate widget for each website or organization; each has its own guid and its own code.
What is the difference between live chat and the operator widget? Live chat is for your website visitors. The operator widget is for your operators, see Operator widgets.