Install the web widget

|

View as Markdown

Add the Live Chat widget to your website so that customers can start conversations. After you install the widget, set its language and test it.

Before you begin, make sure you meet the prerequisites in the quickstart.



Key terms [#key-terms]

The installation and authentication steps use the following terms:



Install the widget [#install-the-widget]

Create the widget first. The installation snippet and the CSP sources appear only after that.

To install the widget on your website:

  1. Log in to your Infobip account.
  2. Go to Channels and Numbers → Channels → Live Chat, select your widget, and expand Installation and security.
  3. In Install Live Chat on your website, select Manual entry and copy the code snippet.
  4. Locate the main HTML frame in your website source code and paste the snippet between the <head> tags.
  5. Save and deploy your website application.

After you deploy your website, website visitors see the widget according to your widget configuration, for example, only on the allowed pages and during office hours.

Website with the Live Chat widget icon in the bottom-right corner

The following example shows the snippet:

HTML
1<!-- Your live chat script -->
2<script>
3 (function(I,n,f,o,b,i,p){
4 I[b]=I[b]||function(){(I[b].q=I[b].q||[]).push(arguments)};
5 I[b].t=1*new Date();i=n.createElement(f);i.async=1;i.src=o;
6 p=n.getElementsByTagName(f)[0];p.parentNode.insertBefore(i,p)
7 })(window,document,'script','https://livechat.infobip.com/widget.js','liveChat');
8 
9 liveChat('init', '<YOUR_WIDGET_ID>');
10</script>

Replace <YOUR_WIDGET_ID> with the ID of your widget. The snippet that you copy from the widget configuration already contains the ID.

NOTEIf your web application is a single-page application (SPA), put the snippet in the main static HTML frame. Otherwise, static HTML is the preferred location. You can also put the snippet into any HTML page where you want to use it. Display only one HTML page with a snippet to your visitors.

For website visitors, you might need to configure the Unauthenticated chat history retention setting. Set it to 24 hours.

The widget works on both HTTP and HTTPS websites, but use it on HTTPS websites only. Because HTTP is insecure, a malicious attacker can tamper with the website content, which makes the widget unsafe for sensitive communications.

NOTEIf you do not configure user authentication for the web widget, all website visitors are flagged as leads by default.


Set the widget language [#set-the-widget-language]

Use the following options to control the language of the widget:



Test the widget [#test-the-widget]

After you install the widget, test it on the showcase page as a visitor and as an authenticated user. For the steps, see Test your widget.



Browser support [#browser-support]

The web widget supports the following browsers for web and mobile responsiveness:

  • Google Chrome and other Chromium-based browsers
  • Brave
  • Edge (Chromium-based)
  • Safari
  • Mozilla Firefox
  • Opera

When the browser window is 480 px wide or less, the widget fills the window. This also applies to narrow windows in desktop browsers.

Live Chat widget that fills the screen of a mobile web browser

For the frameworks that the mobile in-app chat supports, see Supported browsers and frameworks.



Related pages

General settings
Set the widget name, display, threads, and language.

Audience and availability
Control widget visibility, pages, and scheduling.

Authenticate web users
Generate and submit a personalization token for logged-in users.

Content Security Policy (CSP) in Live Chat
Load the widget on websites that use a Content Security Policy.


Was this page helpful?