Installing on web

Updated 

Some Basic Terminology

Live chat can be implemented on websites/blogs/forums by adding a Javascript code on the website. The one-time javascript code embeds the chat automatically on the website. If the website has multiple pages, the javascript code should be embedded in all the pages, preferably near the bottom of the page code. 

Some basic web terminology


HTML - HTML is the markup language (code) that defines the web page structure and data that is visible on the website. All the tags like <p> <br> <div> etc. are HTML tags.


CSS - CSS is the stylesheet that defines how the webpage will look. In layman’s terms, it defines colors, fonts, size, and other style elements of all components on the webpage.


JS/Javascript - Javascript is a piece of the program that is embedded in the webpage which gets executed on the user’s browser. In layman’s term, most of the interactive elements of the website are governed by Javascript

Getting the Embedded Code

Go to Sprinklr Service -> Listen -> Brand Care -> Live Chat care

There find your Livechat application and click on the three dots. From there click "Emebed Code"

After this you will get a popup to chose from Modern or Classic Skin.

Modern skin is our new, sleeker, more stlliysh skin and contains all the latest features. Classic Skin is used for legacy clients. Please chose "Modern" Skin and copy the embedded code that comes up in the next screen

Embedded Code Structure

Embed code is a JavaScript code snippet that is provided for each live chat application. This needs to be added on the website.

The embed code looks like the following 

<script>

    window.sprChatSettings = window.sprChatSettings || {};

    window.sprChatSettings = {

            appId: "XXXXXXXXX", // unique identifier for your livechat application

           skin: "MODERN"

    }; 

</script>


<script>

    (function() {

        var w = window;

        //.. standard code

    })() 

</script>

Putting on website

Once you get the embedded code, you need to put it in the HTML of your website. We recommend putting it near the bottom of the website HTML but before the </body> tag

We don’t initialize the widget until DOMContentLoaded event has been fired so that critical

resources of the web page are not competed with and page performance is not impacted. To optimize the website performance and reduce any impact further, it’s recommended to delay the loading of the live chat JS code i.e. only after loading the website page and its critical components. To do this, see below:

setTimeout(function() {//live chat code to be executed after delay}, delayInMilliseconds);