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
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?


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.


function CustomOpenLHNChat(){

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

if (!lhnWin.closed){


setTimeout(lhnWin.focus(), 10);

return false;




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

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

YOUR_CODE;'' + 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;



Related articles

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

Poor Outstanding