Live Chat operator online/offline detection via JavaScript

I would like to do additional programming on my website but I need to detect whether there are operators online under my account. Is this possible to determine?

You would need to check the value of bLHNOnline JavaScript variable.
The variable will be initialized by LiveHelpNow code on your site so you would need to check bLHNOnline variable's value after LiveHelpNow code installation on your page or in "onload" event of your page's body.

<script>
function LHN_button_onLoad(){
if (bLHNOnline == 0)
    {
     //All operators are offline
    }
else
    {

     //There are operators online
     }}

</script>

 

Related articles