Skip to main content

Present Customer Data to Agent

Customer data

It is possible to share any data with the agent by either initially providing it or update it during an ongoing session. The initial data is provided with a data configuration parameter to new BambuserOneToOneEmbed({ data }). Any updates to the data should be synched with BambuserOneToOneEmbed.updateData(data), and for an ongoing session the new data will be directly shared with the agent.

In order to provide our services effectively, please be informed that the data shared with the agent will be securely transmitted over protected data channels. By default, this data will be stored on our server for the duration of our Personally Identifiable Information (PII) retention policy, which is 28 days. This ensures that we can assist you efficiently and maintain a record of your interactions with our service.

There are two options for how you can provide the data.

Option 1: Static dictionary objects

let oneToOneEmbed = new BambuserOneToOneEmbed({
data: {
externalId: 0
}
});

// Can be updated any time afterwards with:
oneToOneEmbed.updateData({
externalId: 123,
firstName: 'Jon',
lastName: 'Doe'
});

Option 2: Function to dynamically compose the data Using a function that returns either the composed data as a dictionary or if needing to call some external services a Promise.

Example with Promise:

let oneToOneEmbed = new BambuserOneToOneEmbed({
data: function() {
// This will be called any time agent needs the data,
// and that is: initially or when you call the updateData method.
return new Promise((resolve, reject) => {
// Ask our website who the current logged in user is...
fetch('[http://example.com/current-user](http://example.com/current-user)')
.then(function(response) {
return response.json();
})
.then(function(currentUser) {
let data = {
externalId: 0
}

// For logged in users we like to share the user id and name with agent.
if (currentUser) {
data.externalId = currentUser.id;
data.firstName = currentUser.first_name;
data.lastName = currentUser.last_name;
}

return data;
});
});
});

// We know at a later stage that the customer has logged in
// (from being in a not logged in state) and would like
// to share new data with agent:
oneToOneEmbed.updateData();

Built-in properties

To have specific data about the customer that will be picked up automatically one or more of the following properties can be used:

  • externalId - An id representing the user account on your website. (This will be stored in server database to associate calls done by specific customer.)
  • firstName - The customer's first name.
  • lastName - The customer's last name.
  • email - The customer's email address.
  • phone - The customer's phone number.

Custom properties

The data property in the configuration support any other custom fields to be passed as long as it is not a nested structure.

let oneToOneEmbed = new BambuserOneToOneEmbed({
data: {
"Current site": window.top.href
}
});