Webchat Parameters
Load options
There are a couple of load options available for the webchat. To enable, declare an object on the page: “r365_webchat_options”. This object has the following properties:
fullScreen: boolean.
Opens webchat area with bigger height if true. False is default height.
conversationVariables: object.
When defined, this object is uploaded as conversation data for this conversation. This can be usefull when no startform is displayed, but you still want to have data from the client available in the flow.
startDirect: boolean.
When true, the startchat button is not displayed, but instead the chat proceeds to the next stage as if the enduser clicked the start chat button.
formCustomization: object (formCustomizationOptions).
Options to extend the pre chat form as you please.
Form Customization Options
addInputs: function(area).
Area is a jquery object to append the inputs to. This function is called when the prechatform is generated.
onValidate: function(conversationVariables).
This function is called when the user clicks the accept button on the prechatform. Use this function to validate your customizations. Return true if all validations pass, return false if not.
Also, update the conversationVariables object with the values you want to have available in your flow. Its your responsibility to generate error messages etc, if applicable.
Example load options
var r365_webchat_options = {
'fullScreen': true,
'conversationVariables': {'UserId': 'someusername'}
'startDirect': true,
'formCustomization': {
'addInputs': function(area){
area.append("<input id="myPrechatFormInput"… />");
},
'onValidate': function(conversationVariables) {
var input = $('#myPrechatFormInput').val();
if (input) {
conversationVariables.myPrechatFormInput = input;
return true;
} else {
//update your UI with an error message
return false;
}
}
}
};
Cookie Consent
To respect cookie consent, declare a function on the page: “r365_cookie_consent”, that returns either true (consent given) or false (consent not given)
example cookie consent
function r365_cookie_consent() {
if ( /*cookies accepted*/ )
return true;
else
return false;
}