How to Fill Email and Name in a Live Chat

You can automatically fill in email, name, phone, and department using our Javascript API.   This comes in handy if you already know some information about your visitor and don't want them to have to re-enter information.  You can just add this javascript snippet to your webpage or template file in the same location where you includes our live chat script.  Then dynamically pre-fill the information you know about the visitor.

For instance, if you just have an email but no name, you can set that field and hide it on the pre-sales form, so the visitor would only enter their name if that's enabled.

Visitor our Developer API page for details on calling this method.

Here's the quick info on how to call the method.  Make sure the include the onSIApiReady function as this allows our script to load before trying to call the appropriate method:

<script type="text/javascript"> 
function onSIApiReady()  
{ 
  //Will display the tab once the scripts have loaded 
  SI_API.setChatInfo('visitor name','email@test.com','(123) 123-1234','Marketing','I have a question about your products'); 
}; 
</script>

Do you also have additional information that you'd like to send along in the chat request to your agents?  If so, you can use an additional method in our javascript SDK to send over any custom key/value pairs.

<script type="text/javascript"> 
function onSIApiReady()  
{     
var params = [];     
params.push({name:'Member ID',value:'abc'});      
params.push({name:'Order Number',value:'1000'});       
SI_API.addParams(params);  
}; 
</script>