About Attributes
Attributes are metadata used for audience segmentation and personalization. They extend the concept of Tags by adding comparison operators and values to determine whether or not to target a user, helping you better evaluate your audience.
Tags versus Attributes
Consider the example below — you want to target fans of the actor Chris Pine. To accomplish this, you specify an audience of users with the TagMetadata that you can associate with channels or named users for audience segmentation. Generally, they are descriptive terms indicating user preferences or other categorizations, e.g., wine_enthusiast
oder weather_alerts_los_angeles
. Tags are case-sensitive. chris_pine
. Either a user has this tag, or not. Note: These API examples can also be used in the dashboard.
{
"audience": {
"tag": "chris_pine"
}
}
But let’s say you wanted to target fans of All The Chrises: Chris Pine, Chris Evans, Chris Pratt, and Chris Hemsworth. With Attributes, you can set your audience to target users whose favorite_actor
Attribute contains
the value chris
, and you will reach all the Chris fans.
{
"audience": {
"attribute": "favorite_actor",
"operator": "contains",
"value": "chris"
}
}
It’s a silly example, but hopefully you can begin to see the power of comparison operators for Attributes.
Attribute types
User information can be stored in an Attribute as text or as a number, date, or JSON object. Each Attribute type is named for the schema that defines what values it accepts. Text, Number, and Date schemas are determined by Airship. You provide your own schema for JSON Attributes.
Values accepted for each Attribute type:
Attribute type | Value format | Kommentare |
---|---|---|
Text | String | n/a |
Number | Number or float value | When setting Number Attributes, you can provide your value as an integer, float, or string. |
Date | ISO 8601 date-time formatted string: YYYY-MM-DDTHH:MM:SS | You can set an offset by appending the date-time with +HH:MM . For example, 2020-07-20T12:35:42+08:00 . Date Attributes are converted to and stored as UTC. |
JSON | An object containing one or more key-value pairs and arrays | JSON Attributes are not available in Performance AnalyticsA customizable marketing intelligence tool that provides access to reports and graphs based on engagement data.. See following page section for additional information. |
JSON Attributes
JSON Attributes are data objects containing one or more key-value pairs and arrays. You can think of them as collections of information you can assign to a user. Example use cases:
Retailer — Store user preferences and send sale or discount messages about items you know a user will be interested in and with personalized content for their preferred brands, colors, etc.
Airline — Store a user’s booking information and send confirmation and update messages leading up to, during, and after their trip. Messages would contain their confirmation code, flight numbers, origin and destination airport codes, and departure and arrival times.
For each JSON Attribute, you create a template for the structure and what data to store. The template is the schema and the data is defined as properties. Using the above airline use case, you could have an Attribute with ID reservation
and create a schema for the confirmation code and lists of like data types (departures and arrivals) with properties for flight numbers, airport codes, and times.
In addition to the properties defined in your provided schema, each JSON Attribute has a property exp
for its expiration date, represented as the number of seconds since the epoch (January 1st, 1970). After expiration, Airship ignores the Attribute where used in segmentation and personalization. When setting a JSON Attribute on a user, if a value for exp
is not provided, Airship automatically sets a value of 90 days from the current date and time.
Each instance of setting a JSON Attribute on a user is defined by an instance ID, which is used as a reference for the property values set for that user.
The following describes associating the data with users and targeting and personalization options:
Topic | Wie es funktioniert | Airline use case example |
---|---|---|
Setting the Attribute on your audience | Use the API to set JSON Attributes on a user, specifying an instance ID and values for properties. | When a user books a round-trip flight, you could assign the reservation Attribute with instance ID a001 . The JSON data assigned for instance reservation#a001 would contain a list of each flight leg going to the destination and each returning flight leg. |
Targeting the Attribute | You target a JSON Attribute's properties, not the object as a whole. All instances of the Attribute are evaluated for matches. Any user that matches the target is included in the message audience. | For a flight update message, you could target any user with the Attribute reservation where the initial leg of their trip departs from airport PDX . Any user with that Attribute and value PDX for the airport code property would be included in the message audience. |
Personalizing content | In message content, you can reference JSON Attributes by instance ID or evaluate all instances of the Attribute. In both cases, the message content populates with the property values set for a user. | In a flight update message, you could reference reservation properties, and the message would contain user-specific details about how the change affects their trip. |
Categories, data sources, and setup
Attributes can come from the Airship SDKs, users, and you.
Data sources, descriptions, and setup per Attribute category:
To target users based on a unique user ID or other external identifier, do not use Custom Attributes. Instead, target Named UserA customer-provided identifier used for mapping multiple devices and channels to a specific individual..
You can store responses to single choice questions in ScenesA single or multi-screen in-app experience cached on users’ devices and displayed when users meet certain conditions in your app or website, such as viewing a particular screen or when a Custom Event occurs. They can be presented in fullscreen, modal, or embedded format using the default swipe/click mode or as a Story. Scenes can also contain survey questions. and SurveysA question-and-answer experience used to collect and aggregate feedback or generate a net promoter score. Surveys are cached on users’ devices and displayed when users meet certain conditions within your app, such as viewing a particular screen or opening the app a certain number of times. as Attributes.
See the Question content element in Configure Scene content and the Question content element in Create a Survey.
Personalization
You can use Attributes in a message body to personalize content for each user. See Personalizing messages using Attributes.
Kategorien