Setting User Data
At any point, a user’s name and available endpoint may be registered in the WebChat so that the WebAgent it is connected to will be able to use this information to query the CRM Customer Relationship Management, or CRM, is (usually) a software-based, data management method to deal with interactions with customers and potential customers. and display matching customer information.
Note
An Enterprise license or higher is required to access these features.
Important
The WebChat needs to be fully loaded before this can be called, see: WebChat Loaded Event
Configuration
This can be accomplished with the following call:
The username is optional and, when omitted, will be generated by the WebChatDialogueProvider. Without this call the WebAgent will show it is connected to an anonymous user.
Warning
This method can be called from the console as well, so it should not be blindly trusted and extra verification is advised!
Example Script
The following is an example script that can be loaded into your website's html. In this example we loaded a web chat as well as set a email and username:
<script>
WebChat.load();
window.addEventListener('WebChatLoaded', function() {
WebChat.setUser('endpoint@domain.com', 'Username');
});
</script>