Skip to content

Updating a profile

Audiences are joined by matching user profile fields using the audience builder in the Unless dashboard. To be able to set up these audiences, you first need to send us some profile fields using the updateProfile function:

// update the profile with additional data points
Txt.updateProfile([
{key: 'firstName', value: 'John', type: 'text'},
{key: 'role', value: 'CMO', type: 'text'}
])

The update profile function enriches an existing visitor profile with additional data points.

Txt.updateProfile(data)

The data argument is required and should be an array of objects. The data object within the array should be structured as follows:

KeyTypeDescription
keystring requiredThe key to store as a trait.
valuestring requiredThe value to store.
typestring requiredThe type of the data that you are sending, options are text, number, bool, date.