24th Mar 2020


Attributes enable extending the core entities of the Talon.One data model. For example, an online fashion retailer may wish to add a Brand attribute to cart items, a hotel-booking platform might add CheckInTime and CheckOutTime attributes to orders, or an e-commerce shop might want to add a Segment attribute to customer profiles.

Built-in attributes

The core data model defines a small set of common attributes for various entities, such as names for customer profiles and prices for cart items. In addition to these "built-ins", our Attribute Library][] contains a number of pre-defined attributes organized into presets. E.g. the Travel preset contains attributes such as FrequentFlyerId and DepartureCountry. You can add library attributes to your account in the Developer Settings section of our Campaign Manager application.

Custom Attributes

In addition to pre-defined attributes in the Attribute Library, you may also define completely custom attributes. As an example, consider a SaaS service with an in-house community forum. They would like to offer special promotions to active forum users, so they can define a ForumPosts attribute on customer profiles. These custom attributes can be defined in the Developer Settings section of our campaign manager.

⚠️ Talon.one will return a 400 error whenever an unknown attribute (which is not existing in the attribute library) is transferred in a session.

Sending Attributes

You include attributes in update requests for various entities.

For example, consider the ForumPosts attribute from above. To keep the count of forum posts in sync, the forum should perform an updateCustomerProfile operation every time the user makes a post.

Using our Ruby SDK it would look something like this:

talon.update_customer_profile user.id, {
  "attributes" => {
    "ForumPosts" => user.posts.length

Or with our JavaScript SDK:

talon.updateCustomerProfile(user.id, {
  attributes: {
    ForumPosts: await user.postCount()

The attribute value must match the attributes type, which is defined on a per-attribute basis. Currently the following 6 types are supported:

  • string - Any valid JSON string.
  • number - Any valid JSON number, internally these are treated as big decimal numbers.
  • boolean - Either true or false.
  • time - An RFC3999 timestamp.
  • list of strings - Comma separated list of strings.
  • list of numbers - Comma separated list of numbers.

You can also remove any attribute value by setting it to null.

Still need help? Get in touch!
Last updated on 24th Mar 2020

Was this article helpful?

Thank you! You have already voted

If you’d like a member of our support team to respond to you, please send a note to support@talon.one