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:
-
Configured Web Widget Click here.
-
Any host website where you can embed the widget.
-
Widget Embedding Script with all the required credentials explained below.
Installation
Follow these steps to embed the web widget on your host site:
-
Once the web widget is properly configured. Update the configuration details as per the table given below.
-
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
-
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. |
-
Add the script in the head section of the target web application.
<!-- 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 -->