03 - Live Helper chat: How to redirect user to custom page then user clicks on offline widget

Documentation of Live helper chat: https://doc.livehelperchat.com/docs/chat/offline/#disable-the-offline-message-for-a-widget

Let say you want to redirect user to some page then your operators are offline.
You can do that by adjusting your embed code and appending redirect url. E.g

New widget code:

 

offline_redirect: 'https://livehelperchat.com', // Redirect user to this page if chat is offline | Optional

 

Old widget code:

 

<script type="text/javascript">
var LHCChatOptions = {};
LHCChatOptions.opt = {offline_redirect:'http://google.com'};

(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
var refferer = (document.referrer) ? encodeURIComponent(document.referrer.substr(document.referrer.indexOf('://')+1)) : '';
var location = (document.location) ? encodeURIComponent(window.location.href.substring(window.location.protocol.length)) : '';
//po.src = '//demo.livehelperchat.com/index.php/chat/getstatus/(click)/internal/(position)/bottom_right/(hide_offline)/true/(department)/4?r='+refferer+'&l='+location;
po.src = '//demo.livehelperchat.com/chat/getstatus/(click)/internal/(position)/bottom_right/(check_operator_messages)/true/(top)/350/(units)/pixels?r='+refferer+'&l='+location;
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>

Impossibile trovare una risposta?

Cerchi qualcosa di specifico che risieda nelle domande generali? Sfoglia le varie cartelle e categorie pertinenti e troverai larticolo desiderato.

Contattaci