Trigger chat invitations

Is it possible to trigger a chat invitation based on user action, for example if there are products in the shopping cart?

It is possible to trigger chat invitation programmatically on your website.
We recommend using automations founf in Admin Panel -> Chat -> Automations You can find more info on automations here: display a dynamic chat invitation based on unique visitor information.
For example you would like to display chat invitation to a visitor with special product in his/her shopping cart. Or pop an invitation to live chat to a visitor who is about to leave your site without completing a purchase.
For Embedded Chat

To display a custom message you will need to call the following command. There are 3 params needed in the call. The first is the message you would like to send, the second is the delay before showing and the third is if it should play a sound.

lhnJsSdk.showInvite("invitation message", 3, true);


Please find more information witin Embedded Chat SDK docs
For classic popup (legacy)
Simply call the following JavaScript function on pages where LiveHelpNow chat button is installed:
Invite without requiring pre-chat requirements:
function WriteLHNMessage(message,0)
Invite requiring pre-chat requirements:
function WriteLHNMessage(message,1)
var mes='Hello, the shoes you have in your shopping cart go very nicely with black jeanes we actually have on sale at 20% off today. Please accept this chat invitation to learn more';
setTimeout("if (typeof lhnWin == 'undefined') {WriteLHNMessage(mes,1);}",3000);
another example:
<body onload="if (typeof lhnWin == 'undefined') {WriteLHNMessage('Your message',1);}" ...
Click here for instructions to customize the look & feel of the automatic chat invitation.

Related articles