Interaction Data

Modified on Tue, 23 Apr at 9:39 PM

Sometimes you will want to push interaction data from an object on the page, or from GET parameters, passed through the URL. The interaction data API allows you to push any data into your interaction. 

The interaction data you pass in may correlate to the data collection fields, or may be completely separate from this. 

The interaction data API is available after the scripts have loaded, to help determine when the scripts have completed loading, you may hook into our custom config callback:

window.talkativeCustomConfig = {
events: {
enterStandby() {
const someData = [
{
name: 'ticket'
data: 'T1234',
label: 'Ticket Reference',
type: 'string'
},
{
name: 'reference',
data: 'C5678',
label: 'Customer Reference',
type: 'string'
}
];

window.talkativeApi.interactionData.appendInteractionData(someData);

},
}
};

The above example loads the interaction data within the talkativeCustomConfig callback under the enterStandby()

You can populate this array from other examples, including pulling data from the get parameters and then mapping this into an array. Each object in the array should have the data itself, a label describing the data, and  the type of data, the type being a JavaScript type.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article