PHP Live! Help Desk
» Help Desk Home » APIs and Integrations » Pre-populate visitor name and email chat request field
Pre-populate visitor name and email chat request field

To pre-populate the visitor name and email value on the visitor chat request form, you'll want to place a small JavaScript code on your webpages. We have opted to go with the Javascript method because the integration is straight forward with much flexibility. When the PHP Live! HTML code detects the "phplive_v" variable on the webpage, the system will carry those values to the visitor chat window. For websites with a standard header or footer included throughout all the pages, this method of integration is effortless. If the Name and Email fields are passed via the "phplive_v" variable, the fields will not be editable on the chat request form.

 

<script type="text/javascript">

<!--

var phplive_v = new Object ;

phplive_v["name"] = "The Name" ;

phplive_v["email"] = "The Email" ;

//-->

</script>

 

To pass a PHP variable to the JavaScript, replace "The Name" and "The Email" to a PHP value, such as:

 

phplive_v["name"] = "<?php echo $name ?>" ;

phplive_v["email"] = "<?php echo $email ?>" ;

 

Custom Variables (PHP Live! v.4.2.109+)

To integrate custom variables to be displayed on the operator console (such as ticket #, login, etc), add the custom variables to the phplive_v variable.  As an example:

 

<script type="text/javascript">

<!--

var phplive_v = new Object ;

phplive_v["Login"] = "<?php echo $login ?>" ;

phplive_v["CID"] = "<?php echo $customer_number ?>" ;

//-->

</script>

 

Was this documentation helpful to you?
© OSI Codes Inc. All Rights Reserved  /  Privacy Policy  /  License Agreement  /  download live chat icons  /  help desk  /  contact us » follow us on Google+ Google Plus