How to keep VID persistent and associate always same VID

Last modification: 2017-02-28 14:07:15

This is usefull, if you want to have same vid across multiple user devices once user is logged. Just have in mind vid value cannot be longer than 50 characters. In JS to keep same VID the same always for logged visitor JS could look like

Set VID if user is logged.

LHCChatOptions.callback = {};
LHCChatOptions.callback.loaded = function(inst){
inst.setVid('<?php echo md5($user_id .  $user_email)?>');

You can also set VID manually. System will detect old VID if it exists and map old settings to provided VID

<input type="button" value="Set VID" onclick="lh_inst.setVid('<?php echo md5($user_id .  $user_email)?>')"></input> 

How to merge using REST API?

$response = $LHCRestAPI->execute('setnewvid', array(
'vid' => '42rsfye2cwolnu3vst', // Old VID
'new' => 'lbv6mnwc2jg4mmxmx5w', // New VID
), array(
), 'POST');

See example here

Support project

Developing application takes a lot of time. You can support application by donating. There is no company behind this application and it takes away my free time. Every donation matters and does not matter how small it is!

Paypal, one time donation
Monthly donation

comments powered by Disqus