Customizing the Pre-chat and Offline Survey
You can easily customize the LivePerson surveys. This can be used for example to:
Customizing the Offline Survey
The LivePerson application server determines if your operators are online or offline and displays the appropriate LivePerson button. When no operators are available and a visitor clicks on the LivePerson button, LivePerson will automatically present the "Offline Survey" window. The offline message will be sent to you by email. If you prefer, you can now present to your visitors your own contact form instead of the LivePerson built-in "Leave a Message" window.
See illustration below:
You can achieve that by adding the "offlineURL" value pair in the button as shown in the example below:
<!-- BEGIN LivePerson Button Code -->
<table border='0' cellspacing='0' cellpadding='0'>
<tr><td align='center'>
<a href='http://server.iad.liveperson.net/hc/YOURSITEID/?cmd=file&file=visitorWantsToChat
&offlineURL=http://www.yourSite.com/contactUs.htm&site=YOURSITEID&byhref=1'
target='chatYOURSITEID'onClick="window.open('http://server.iad.liveperson.net/hc/
YOURSITEID/?cmd=file&file=visitorWantsToChat&offlineURL=http://www.yourSite.com/contactUs.htm
&site=YOURSITEID&referrer='+document.location,'chatYOURSITEID',
'width=472,height=320');return false;"><img src='http://server.iad.liveperson.net/
hc/YOURSITEID/?cmd=repstate&site=YOURSITEID&category=
en;woman;1&ver=1' name='hcIcon' width=150 height=50 border=0></a>
</td></tr>
<tr><td align='center'>
<a href='http://server.iad.liveperson.net/hc/YOURSITEID/?
cmd=PoweredByPage&site=YOURSITEID' target='_top'>
<img src='http://server.iad.liveperson.net/hc/YOURSITEID/?
cmd=hccredit&site=YOURSITEID' width=106 height=35 border=0></a>
</td></tr>
</table>
<!-- END LivePerson Button code --> |
Replace YOURSITEID with your LivePerson account number.
Replace the link in the example (http://www.yourSite.com/contactUs.htm)
with the link to your custom contact form.
If you would like to open the Offline clicks into a full browser window (with scrolling bar and full screen size), you will need to set up a redirect on the offline target page.
The redirect can be done with JavaScript with a command to close the offline target page.
See the example below:
<script>
window.open('http://www.yoursite.com/myFullPageContactFrom.htm');
window.close()
</script> |
Customizing the Pre-Chat Survey
The methodology is very similar to the customization of the offline survey.
You can achieve that by adding the "onlineURL" value pair in the button as shown in the example below:
<!-- BEGIN LivePerson Button Code -->
<table border='0' cellspacing='0' cellpadding='0'>
<tr><td align='center'>
<a href='http://server.iad.liveperson.net/hc/YOURSITEID/?cmd=file&file=visitorWantsToChat
&onlineURL=http://www.yourSite.com/onlineSurvey.htm&site=YOURSITEID&byhref=1'
target='chatYOURSITEID'onClick="window.open('http://server.iad.liveperson.net/hc/YOURSITEID/
?cmd=file&file=visitorWantsToChat&
onlineURL=http://www.yourSite.com/onlineSurvey.htm
&site=YOURSITEID&referrer='+document.location,'chatYOURSITEID',
'width=472,height=320');return false;"><img src='http://server.iad.liveperson.net/
hc/YOURSITEID/?cmd=repstate&site=YOURSITEID&category=
en;woman;1&ver=1' name='hcIcon' width=150 height=50 border=0></a>
</td></tr>
<tr><td align='center'>
<a href='http://server.iad.liveperson.net/hc/YOURSITEID/?
cmd=PoweredByPage&site=YOURSITEID' target='_top'>
<img src='http://server.iad.liveperson.net/hc/YOURSITEID/?
cmd=hccredit&site=YOURSITEID' width=106 height=35 border=0></a>
</td></tr>
</table>
<!-- END LivePerson Button code --> |
Replace YOURSITEID with your LivePerson account number.
Replace the link in the example (onlineURL=http://www.yourSite.com/onlineSurvey.htm)
with the link to your custom pre-chat form.
The "preChatSurveySubmit" command is used to send the data you collected to the LivePerson application. The LivePerson server will record that the pre-chat survey has been filled.
All the data you collected in the pre chat survey will be stored as custom variables and presented in the LivePerson application (UI info tab and reports) as Pre-Chat survey data. As a response to this URL, the LivePerson server opens the chat window.
This is how you need to alter your custom prechat form in order to have the Submit button launch the chat:
<!-- Form Action: Replace XXXXXXXX with Site ID -->
<form name=PreChatCustomForm action="http://server.iad.liveperson.net/hc/XXXXXXXX/">
<input type="hidden" name="cmd" value="file">
<input type="hidden" name="file" value="preChatSurveySubmit">
<input type="hidden" name="site" value="XXXXXXXX">
<!-- End of Form Action -->
<!-- Customizable Fields -->
<!-- Example of a text field - the value of the 'name' is passed on as tracking variable - use SESSIONVAR!variable -->
<p>
What is your name:
<input type="text" name="SESSIONVAR!identifier">
</p>
<!-- End of text field -->
<!-- Example of a drop down box -->
<p>
Have you purchased online before?
<select size="1" name="SESSIONVAR!PreviousPurchase">
<option>Yes</option>
<option>No</option>
</select>
</p>
<!-- End of drop down box -->
<!-- Start Chat/Submit Button -->
<p>
<input type="submit">
</p>
<!-- End of Chat/Submit Button -->
</form> |
In order for the custom Pre-Chat survey to open with manual and auto invitation, you must add the following tag just before the monitor code.
<script>
var lpOpenParms="onlineURL=http://www.yourSite.com/onlineSurvey.htm";
</script> |
Replace the link in the example (onlineURL=http://www.yourSite.com/onlineSurvey.htm)with the link to your custom pre-chat form.