Instructions on how to integrate the popular chat solution from LiveChat with WS.WebTV.
support, ws.webtv, home, chat, integration, live, livechat
LiveChat is a popular chat (online tool for customer service) solution that can be integrated into Websites. When integrated with WS.WebTV, it will allow you to offer online support (via chat), to your users, directly through your WebTV.
The simplest way of integrating LiveChat is by getting their code and pasting it into the WebTV. Instructions:
1. Log into LiveChat
2. Go to the Code section.
3. Copy the code....
4. Log into your WebTV
5.A. If you want to include it across all the pages of the WebTV then:
5.A.1. Go to Configuration > General > Additional HTML Code
5.A.2. Paste the code into "Statistics & </body> section HTML code" field and save.
5.B. If you ONLY want to include it in a specific Channel/Page of the WebTV then:
5.B.1. Edit the desired Channel/Page and open the "Advanced" tab.
5.B.2.
Paste the code into "Additional HTML code (styles, scripts...)" / "Statistics & </body> section HTML code" field and save.
Is it possible to include it only in the page of a specific Clip?
Yes...
- Modify your code and wrap it up, like this (replace CLIP_ID with the ID of the Clip):
if ( window.location.href.indexOf("/video/ID_CLIP/")>1 )
{ // The LiveChat code goes below this line
} // The LiveChat code goes above this line
- Enter the modified code according to 5.A.
This requires a bit of extra work but will allow you to identiy the users which are logged in the WebTV; therefore, if an user is logged in then you will be able to know who is he/she.
1. Log into LiveChat
2. Go to the Code section.
3. Copy the code....Your code will look like this:
<script type="text/javascript">
var __lc = {};
__lc.license = 12345678; // ----------> BEWARE THIS MUST BE YOUR LICENSE
(function() {
var lc = document.createElement('script'); lc.type = 'text/javascript'; lc.async = true;
lc.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.livechatinc.com/tracking.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(lc, s);
})();
</script>
4. Now, lets add some extra code below the __lc.license line ...:
<script type="text/javascript">
var __lc = {};
__lc.license = 12345678; // ----------> BEWARE THIS MUST BE YOUR LICENSE
<!-- -------------------- extra code starts here.... -------------------- -->
var usrID='{user.id}';
var usrEmail='{user.email}';
var usrName='{user.name} {user.surname}';
var usrLogin='{user.login}';
if ( usrName == ' ' ) usrName = usrEmail;
__lc.visitor = {
name: usrName ,
email: usrEmail
};
__lc.params = [
{ name: 'Login', value: usrLogin },
{ name: 'Account ID', value: usrID },
];
<!-- -------------------- extra code ends here... -------------------- -->
(function() {
var lc = document.createElement('script'); lc.type = 'text/javascript'; lc.async = true;
lc.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.livechatinc.com/tracking.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(lc, s);
})();
</script>
NOTE: If you only want to display the chat widget to users which are logged in, then add if (usrLogin!='') before (function()... like this:
...
if (usrLogin!='')
(function() {
var lc = document.createElement('script'); lc.type = 'text/javascript'; lc.async = true;
lc.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.livechatinc.com/tracking.js';
...
5. Log into your WebTV
6.A. If you want to include it across all the pages of the WebTV then:
6.A.1. Go to Configuration > General > Additional HTML Code
6.A.2. Paste the code into "Statistics & </body> section HTML code" field and save.
6.B. If you ONLY want to include it in a specific Channel/Page of the WebTV then:
6.B.1. Edit the desired Channel/Page and open the "Advanced" tab.
6.B.2.
Paste the code into "Additional HTML code (styles, scripts...)" / "Statistics & </body> section HTML code" field and save.
Is it possible to include it only in the page of a specific Clip?
Yes...
- Modify your code and wrap it up, like this (replace CLIP_ID with the ID of the Clip):
if ( window.location.href.indexOf("/video/ID_CLIP/")>1 )
{ // The LiveChat code goes below this line
} // The LiveChat code goes above this line
- Enter the modified code according to 6.A.
In case of doubts, or requiring help for integration, contact Us, we can offer you our tech service.