You can add custom data on top of the response captured by the form in two ways.
Using URL Parameters
Our forms can automatically capture keys from a URL and send them along with the rest of the data. To set this up, go to your form's Settings, then click Data Collection, and use Add custom field to add the keys you want to capture, as shown below.
Here you can provide the keys present in the URL as custom variables. You can add multiple keys using the + Add custom field button.
Note: This only works when the form is used in Widget mode or as a Link. If the form is embedded via iframe, it cannot read URL parameters, so this method will not work in Embed mode.
collectchat.set(key, value)
You can also add custom data using this JavaScript method. Data added this way can be used in the conversation via @ tags, and is sent along with the rest of the response. Both key and value are required, and the key must be added as a custom field under Settings > Data Collection.
Sample code to set the email address of a user, if you already have the data:
var collectchat = window.collectchat || {};
collectchat.ready = function() {
collectchat.set('email', '[email protected]');
}