Help Desk Software
Support Center > Knowledge Base> Article: Perform an action in a custom code before chat launch

Perform an action in a custom code before chat launch

Article ID: 11426 Email Print
Question
I would like to set a cookie or do any other action for the visitor who is about to launch chat window, how can I do that?

Answer

You would need to overide LiveHelpNow chat launch code by adding "CustomOpenLHNChat" javasript function to your page.
This assumes that you have LiveHelpNow chat button code installed on the page.

Please replace LHNACCOUNTID with NUMERIC portion of your LiveHelpNow account #  and YOUR_CODE with whatever action you would like to perform for the visitor.

<SCRIPT>

function CustomOpenLHNChat(){

if (typeof lhnWin !== 'undefined' && lhnWin){

if (!lhnWin.closed){

lhnWin.blur();

setTimeout(lhnWin.focus(), 10);

return false;

}

}

 

var wleft = (screen.width - 580-32) / 2;

var wtop = (screen.height - 420 - 96) / 2;

YOUR_CODE;

lhnWin=window.open('https://www.livehelpnow.net/lhn/livechatvisitor.aspx?lhnid=LHNACCOUNTID&d=' + lhnDepartmentN + '&zzwindow=' + lhnWindowN, 'lhnchat',
'left=' + wleft + ',top=' + wtop +',width=580, height=435,toolbar=no,location=no,directories=no, status=yes,menubar=no,scrollbars=no,copyhistory=no,resizable=yes');

return false;

}

</SCRIPT>


Related articles

Article Details
Views: 6777 Created on: Sep 05, 2011
Date updated: Apr 04, 2017

Poor Outstanding