You are using an unsupported browser. Please update your browser to the latest version on or before July 31, 2020.
Home > Features > How to preset customer name and email on chat widget
How to preset customer name and email on chat widget
print icon

This can be done programmatically. You can send in your signed-in user’s name and email by simply calling the setVisitorInfo method to pass those details. This will skip the pre-chat form for the users.

Mandatory properties that needs to be set are:

  • name
  • email

Syntax - setVisitorInfo

HappyFoxChat.setVisitorInfo(<visitorInfoObject>, <callback>);

<visitorInfo[Object]> should have two mandatory properties name and email.


HFCHAT_CONFIG.onload = function() {
var HappyFoxChat = this;
HappyFoxChat.setVisitorInfo ({
'name': ‘Bob’,
'email': ‘’
}, function(err, resp) {
if(err) {
console.error('Failed to set visitor details. Error:', err);
} else {
console.log('Added visitor details:', resp);

Important Note:

  • This API method should be called only after the script is loaded.
  • You can add your HappyFox Chat API related code with in the `onload` function.

Once a customer logs into your website and clicks on the chat widget their name will be shown directly instead of a pre-chat form.

0 out of 0 found this helpful

scroll to top icon