Prefill email and name for customer

When your chat button or contact form is integrated within your CMS you usually already know the e-mail address and name of your customer so you do not need to ask for it in a contact form.
You can prefill both the e-mail address, name or phone of the customer or any custom value by adding some special code to your widget code.

Since version 5.17 prefill methods logic has been changed and new method has been added. 
More info here: http://support.ladesk.com/147815-Set-visitor-specific-values-with-javascript

 

And now a quick one-line solution examples...

Chat buttons

Regarding chat buttons, you are supposed to modify the original integration code
<script type="text/javascript">
(function(d, src, c) { var t=d.scripts[d.scripts.length - 1],s=d.createElement('script');s.id='la_x2s6df8d';s.async=true;s.src=src;s.onload=s.onreadystatechange=function(){var rs=this.readyState;if(rs&&(rs!='complete')&&(rs!='loaded')){return;}c(this);};t.parentElement.insertBefore(s,t.nextSibling);})(document,
'//URL_TO_LiveAgent/scripts/track.js',
function(e){ LiveAgent.createButton('16756da8', e); });
</script>
this way:
<script type="text/javascript">
(function(d, src, c) { var t=d.scripts[d.scripts.length - 1],s=d.createElement('script');s.id='la_x2s6df8d';s.async=true;s.src=src;s.onload=s.onreadystatechange=function(){var rs=this.readyState;if(rs&&(rs!='complete')&&(rs!='loaded')){return;}c(this);};t.parentElement.insertBefore(s,t.nextSibling);})(document,
'//URL_TO_LiveAgent/scripts/track.js',
function(e){ 
LiveAgent.setUserDetails('customer@email.com', 'First name', 'Last name'); 
LiveAgent.createButton('16756da8', e);
});
</script>
 
The row with bold letters
LiveAgent.setUserDetails('customer@email.com', 'First name', 'Last name'); 
was the one that was added to the original integration code.
 

Contact form

Regarding contact forms it is the same - if you compare the contact button and contact form code, then you will notice, that the only change is this:
LiveAgent.createButton()  there is LiveAgent.createForm() so there is no difference between applying the above mentioned integration to a contact button code or to a contact form code. 
 
Note: This integration is available for version 2.4 and higher.
 

Phone support

Since version 4.3.7.2 you can also prefill phone number in user details. This is the function form:
LiveAgent.setUserDetails(email, firstName, lastName, phone)

Ready to try LiveAgent?

It's free for the first 14 days! No credit card required.

Get Started
We work well with others...
Magento Joomla Wordpress Mailchimp
Contact us

support@liveagent.com

+1-800-811-6590 (Toll Free in USA & Canada)

+421 2 33 456 826 (European Union & Worldwide)

Quality Unit, LLC 616 Corporate Way, Suite 2-3278 Valley Cottage, NY 10989

Stay in touch
Blog Google+
© 2004-2020 LiveAgent.com, All rights reserved