Skip to main content
Skip table of contents

CX Customer Widget Embedding Guide

This guide covers the supported options to embed the web widget.

Embed in Website

The Web Widget can be embedded in any third-party website to enable web widget capabilities.

Prerequisites

Make sure you have the following things available before embedding:

  1. Configured Web Widget Click here.

  2. Any host website where you can embed the widget.

  3. Widget Embedding Script with all the required credentials explained below.

Installation

Follow these steps to embed the web widget on your host site:

  1. Once the web widget is properly configured. Update the configuration details as per the table given below.

  2. Once the configuration is updated, add that script at the top in the Head tag <head> of the HTML Code of the target web application script provided below. 

Script

  1. Update the following configuration in the script.

Config Parameter

Description

customerWidgetUrl

IP or FQDN of the server where the Customer Widget is hosted.

widgetIdentifier

The widget identifier of the web widget instance is defined in the Unified Admin. 

serviceIdentifier

This is the service identifier of the web channel defined in the Unified Admin.

  1. Add the script in the head section of the target web application.

JS
<!-- CIM Script Tags -->
<script type="text/javascript">
  var __cim = __cim || {};
  __cim.customerWidgetUrl = "https://[HostName]/customer-widget"; //Customer Widget Url 
  __cim.widgetIdentifier = "web"; //Widget Identifier
  __cim.serviceIdentifier = "+921218"; //Service Identifier

  (function () {
    var __cimScript = document.createElement("script"),
        __cimScriptTag = document.getElementsByTagName("script")[0];
    __cimScript.src = __cim.customerWidgetUrl + "/assets/widget/init_widget.js";
    __cimScript.charset = "UTF-8";
    __cimScriptTag.parentNode.insertBefore(__cimScript, __cimScriptTag);
  })();
</script>
<!-- End CIM Script Tags -->

 

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.