PHP Live! Help Desk
Search:
» 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 pre-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 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.

 

IMPORTANT:

Custom variable names and custom variable values should not contain double quotes (") or single quotes (').

 

<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 your own custom variables to be displayed on the operator console (such as ticket #, login, customer ID, etc), add the custom variables to the phplive_v variable.  As an example:

 

<script type="text/javascript">

<!--

var phplive_v = new Object ;

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

phplive_v["Login"] = "<?php echo $login ?>" ; // your own custom variable

phplive_v["CID"] = "<?php echo $customer_ID ?>" ; // your own custom variable

//-->

</script>

 

Custom fields are visible to the chat operators during a chat session and the values are also saved to the database and can be viewed at anytime (chat transcripts, leave a message, etc).  If the JavaScript custom variable name matches any of the pre-defined custom fields (Setup Admin -> Departments -> Pre-Chat), the value will automatically be populated for that field and the field will not be editable on the chat request form.

 

Was this documentation helpful to you?
Home  |  About  |  Clients  |  Features  |  Help Desk  |  Live Demo  |  Free Trial  |  Contact Us  |  Live Chat
© OSI Codes Inc. All Rights Reserved, Privacy Policy - PHP Live! is a product by by OSI Codes Inc.   PHP Live! on Google Plus Google Plus
50.16.116.99