Pass Custom User DataΒΆ

The custom_properties variable allows you to pass any custom data to Talkable as a collection of Key-Value pairs. Those can be used for various segmentation purposes, since join criteria and incentive criteria are capable of using the ones in conditions.

All data associated with custom_properties is available for use across all Campaign Views.

How to set

Initialization script

Add the custom_properties collection in the authenticate_customer call of the Initialization script.

_talkableq.push(['authenticate_customer', {
  email: '',
  custom_properties: {
    person_occupation: 'marketing',
    eye_color: 'brown'
  }
}]);

Post-purchase script

Add the custom_properties collection to the data passed in the register_purchase call. It should be nested the same as purchase collection.

var _talkable_data = {
  purchase: {
    order_number: '',
    subtotal: '',
  },
  custom_properties: {
    person_occupation: 'marketing',
    eye_color: 'brown'
  }
};
_talkableq.push(['register_purchase', _talkable_data]);

Loyalty script

The properties you add to the initialization script will be automatically passed to all loyalty calls.

Note

The values you pass in the custom_properties have to be JSON Key-Value pairs themselves, meaning that complex nested data structures cannot be passed through. Property names (e.g. eye_color) can contain lowercase letters, numbers and _ only and cannot begin with a number.

How to use

To access custom_properties in Talkable, use:

{{ advocate_custom_properties }}
{{ friend_custom_properties }}
{{ member_info.custom_properties }}

Key-Value pairs can be referenced calling the desired data key, such as:

{{ advocate_custom_properties.eye_color }}

Note

Any custom_properties data passed through is tied to the Advocate, Friend, or Loyalty member. If Talkable receives a custom property that was previously defined for the user, the property gets overwritten with a new value.