Attributes
An attribute represents a characteristic of a given entity, and you can use it in your rules.
Each attribute is described by its:
- Type, for instance,
string
ornumber
. - Definition:
- Built-in attributes: They are provided by Talon.One.
- Custom attributes: They are created by you.
There is no difference in use. You can choose to use only custom attributes if you want.
Examples:
- An online fashion retailer might add a Brand attribute belonging to cart items to apply discounts on a given brand.
- A hotel-booking platform might add the CheckInTime and CheckOutTime attributes to customer sessions and trigger extra notifications depending on the season.
- An ecommerce shop might add a Segment attribute to customer profiles to trigger targeted campaigns.

Built-in attributes
The core data model defines a small set of common attributes for many entities, such as names for customer profiles and prices for cart items.
The Attribute Library contains a number of pre-defined attributes organized into presets. For example, the Travel preset contains attributes such as FrequentFlyerId and DepartureCountry.
Enabling a built-in attribute
Some built-in attributes are not enabled by default. To view and enable them:
- Open the Attribute library: in the bottom-left of the Campaign Manager, click Account > Tools > Attributes and Attribute library in the top-right corner.
- In the predefined Attributes panel, click the Filter by industry dropdown and select an industry.
- To add a built-in attribute, in the list of attributes, click +.
Depending on your attribute usage, you can control the visibility of attributes in the Attribute Selector. See Managing attribute visibility.
Custom attributes
You can define your own attributes to manipulate the data of your choice.
Let's imagine a SaaS service with an in-house community forum. We want to offer special promotions to active forum users, so we define a ForumPosts attribute on the customer profile entity.
Creating a custom attribute
- In the bottom left of the Campaign Manager, click Account > Tools > Attributes.
- Click Create Attribute in the top-right corner.
- Fill in the fields as needed and click Create Attribute. Use its API name to set the value programatically and the Rule Builder name to use it in rules.
Setting attributes
Once you have created attributes, or once you know which built-in ones to use, you can assign values to them programatically with the following endpoints:
- Update customer profile for customer profile attributes.
- Track event endpoint for event attributes.
- The campaign settings for campaign attributes.
- The Application settings for Application attributes.
- Update customer session for all other attributes.
For example, consider the ForumPosts attribute from above. To keep the count of forum posts synced between Talon.One and the forum, we can use the updateCustomerProfile endpoint every time the user makes a post to update the stats.
- curl
- JavaScript
- Ruby
Using the updateCustomerProfile endpoint:
CURL -X PUT https://mycompany.europe-west1.talon.one/v2/customer_profiles/{sessionId} -d
'{
"attributes": {
"ForumPosts": someValue
}
}'
Using the JavaScript SDK:
talon.updateCustomerProfileV2(user.id, {
attributes: {
ForumPosts: await user.postCount()
}
})
Using the Ruby SDK:
talon.update_customer_profile_v2 user.id, {
"attributes" => {
"ForumPosts" => user.posts.length
}
}
The attribute value must match the attributes type. The following types are supported:
string
- Any valid JSON string.number
- Any valid JSON number, internally these are treated as big decimal numbers.boolean
- Eithertrue
orfalse
.time
- An RFC3339 timestamp.location
- See Using geolocation.list of strings
- Comma separated list of strings. Contains up to 1000 items.list of numbers
- Comma separated list of numbers. Contains up to 1000 items.
You can also remove any attribute value by setting it to null
.
Talon.One will return a 400 error whenever an unknown attribute is transferred in a session. An unknown attribute doesn't appear in the Attribute Library.
Attribute library
The attribute library lists all the attributes available in Talon.One, built-in and custom.
To open the attribute library:
- In the bottom-left corner, click Account > Tools > Attributes.
- Click Attributes Library at the top of the screen.
Customer profile built-in attributes
Only attributes marked with a * are enabled by default. All others attributes must be enabled first from the attribute library.
- IntegrationId: the identifier of the entity. It has the same value as the
profileId
of the customer session entity. - BirthDate*
- Email*
- Name*
- SignupDate*
- AccountState
- AdditionalEmails
- AdGroup
- Billing
- BillingAddress1
- BillingAddress2
- BillingAddress3
- BillingAddress4
- BillingCity
- BillingName
- BillingPostalCode
- BillingSalutation
- Browsername
- DeviceCategory
- Fax
- FirstOrderDate
- FlashVersion
- FrequentFlyerId
- FrequentFlyerPoints
- FrequentFlyerProgram
- FrequentFlyerStatus
- FrequentFlyerStatusPoints
- Gender
- Keyword
- LandingPage
- Language
- Languagename
- LastOrderDate
- Locale
- Medium
- MembershipDuration
- OperatingSystem
- OrderCount
- PageVisitedProfile
- PaymentIdHash
- PaymentMethod*
- Phone
- ReferralPath
- ReviewCount
- ReviewsWords
- SessionCount
- ShippingAddress1
- ShippingAddress2
- ShippingAddress3
- ShippingAddress4
- ShippingCity
- ShippingCountry
- ShippingName
- ShippingPostalCode
- ShippingSalutation
- Source
- TotalOrders
- URL
Customer session built-in attributes
Only attributes marked with a * are enabled by default. All others attributes must be enabled first from the Attribute library.
- IntegrationId: the identifier of the session. It cannot be set via the
attributes
property of the Update customer session endpoint. It is set automatically via the endpoint's URI parameter. - ProfileId: the identifier of the customer owning the session. It has the same value as the
IntegrationId
of the customer profile entity. It is set via theprofileId
property of the Update customer session endpoint.
The following attributes are set using the attributes
property of the
Update customer session endpoint:
- CurrentLocation*
- PaymentMethod*
- ShippingCost*
- ShippingMethod*
- BillingAddress1
- BillingAddress2
- BillingAddress3
- BillingAddress4
- BillingCity
- BillingCountry
- BillingName
- BillingPostalCode
- BillingSalutation
- Browser
- BrowserVersion
- ClickedOn
- Device
- IPAddress
- LandingPage
- Language
- OS
- Pagetitle
- PageVisited
- PaymentIdHash
- Platform
- ScreenResolution
- SessionDuration
- ShippingAddress1
- ShippingAddress2
- ShippingAddress3
- ShippingAddress4
- ShippingCity
- ShippingCountry
- ShippingName
- ShippingPostalCode
- ShippingSalutation
- TimeOnPage
Cart item built-in attributes
Most of these attributes must be enabled first from the Attribute library.
- DepartureDate
- ArrivalDate
- Duration
- DestinationCountry
- DestinationCity
- DestinationAirport
- DepartureCountry
- DepartureCity
- DepartureAirport
- NumberOfSegments
- CountryPair
- DestinationStation
- DepartureStation
- BookingClass
- Pax
- FlightNumber
- FlightNumberReturn
- Tax
- PassengerSegment
- BaggageAllowance
- BaggagePieces
- BookingExtras
- Pickup
- Dropoff
- Rating
- TicketType
- VenueName
- VenueType
- VenueCity
- VenuePostcode
- VenueCountry
- VenueDistrict
- VenueStatus
- VenueOpeningHours
- VenueKitchenType
- VenueDistance
- VenueMealCount
- VenueDeliveryTime
- VenueBudgetCategory
- VenueRating
- VenueId
- VenueMealType
- VenueDescription
- VenuePhone