About attributes
Use attributes to target audiences with comparison operators and personalize message content.
How attributes work
Attributes are metadata you attach to a channelA device or address registered with Airship to receive messages, such as a mobile app, web browser, email address, or SMS number. It stores opt-in status, device-specific information, and metadata used for targeting. Each channel has a unique channel ID. or named userA contact identified with an ID you provide, such as a customer ID from your CRM. Associating channels with that ID maps multiple devices and channels to one individual. Each named user has a unique named user ID. for audience segmentation and personalization. Airship evaluates attributes by comparing stored values with operators, not by presence or absence, so use them to store values such as lifetime_purchase_total or favorite_movie.
When targeting your audience, you can refine with operators such as equals, contains, greater than, and before or after. For JSON attributes, target individual properties within the object. You can also store responses to single choice questions in ScenesA mobile app or web experience of one or more screens displayed with fully native UI components in real time, providing immediate, contextual responses to user behaviors. Scenes can be presented in full-screen, modal, or embedded format using the default swipe/click mode or as a story. Scene content can also be displayed in a Message Center message and contain survey questions. as attributes. Personalize message content with the same values and properties.
Add attributes to your project, and set them on or remove them from users using the SDK or API, or by uploading a CSV in the dashboard. Airship also sets some attributes automatically, such as device locale and the Named User ID attribute.
When you only need presence or absence for future campaigns, such as wine_enthusiast, use a tagMetadata that you can associate with a channel or named user for audience segmentation. Generally, a tag is a descriptive term indicating a user preference or other categorization, such as wine_enthusiast or weather_alerts_los_angeles. instead.
Attributes versus tags
Targeting with attributes can be more precise than with tags. For example, a theater promoter announcing a screening wants to target fans of the movie Jaws 3-D, so they send a message to users with the tag jaws_3_d. Audience members either have the tag or they do not.
{
"audience": {
"tag": "jaws_3_d"
}
}For a festival running Jaws, Jaws 2, Jaws 3-D, and Jaws: The Revenge, instead of specifying a separate tag for each movie, they would target users whose favorite_movie attribute contains the value jaws, and reach all of them with one audience selector.
{
"audience": {
"attribute": "favorite_movie",
"operator": "contains",
"value": "jaws"
}
}It’s a light example, but it shows the power of comparison operators for attributes. These API examples can also be used in the dashboard.
Using attributes with messaging
Attributes support the following messaging capabilities:
- Targeting — Target audiences for messages, feature flagsAn experimentation tool for controlling the availability of content or functionality in your app or website. A flag’s Configurations determine the audience, schedule, and property values to apply when the flag is enabled. Flag properties enable making immediate code updates, bypassing the need for traditional code changes and release processes., A/B tests, and Intelligent Rollouts based on attribute values and comparison operators. You can also include attributes in segmentsA reusable audience group you create by selecting unique or shared user data.. See Targeting your audience using attributes.
- Personalization — Use attribute values in message content with HandlebarsHandlebars is Airship’s templating language for personalization. Handlebars expressions use double curly braces wrapped around a content template, ranging from a simple variable, e.g.,
{{first_name}}, to complex evaluations of personalization data.. See Personalizing messages using 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 | Comments |
|---|---|---|
| Text | String | Text strings can be a maximum of 255 characters. |
| 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 string, number, date, or boolean key-value pairs, individually or within objects or 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 string, number, date, or boolean key-value pairs. The pairs can be added individually or within objects or 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. The maximum expiry delay for a JSON attribute is 731 days.
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 | How it works | Airline use case example |
|---|---|---|
| Setting the attribute on your audience | Use the SDKs or 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. The following table shows the data sources, descriptions, and setup required for each attribute category:
| Category | Data source | Description | Setup |
|---|---|---|---|
| Default | Airship SDKs or customer | The Airship SDKs automatically set default attributes on your audience based on device data such as locale, time zone, and OS. For email, SMS, and open channels, you can assign values that do not come from a device. See Device properties. | None. |
| Named user ID | Airship | If a channel has a named userA contact identified with an ID you provide, such as a customer ID from your CRM. Associating channels with that ID maps multiple devices and channels to one individual. Each named user has a unique named user ID., Airship automatically generates this attribute, with the named user ID as its value. See Named user ID attribute in the Attributes Reference. | None. |
| NPS survey | User answers to Net Promoter Score (NPS) surveys in ScenesA mobile app or web experience of one or more screens displayed with fully native UI components in real time, providing immediate, contextual responses to user behaviors. Scenes can be presented in full-screen, modal, or embedded format using the default swipe/click mode or as a story. Scene content can also be displayed in a Message Center message and contain survey questions. | Airship automatically generates attributes based on the NPS score or category. See NPS Segmentation in Surveys and Stories and NPS survey attributes in the Attributes Reference. | None. |
| Predefined | Customer | Preformatted Text and Number attributes you can use to ensure consistency across reports and Performance AnalyticsA customizable marketing intelligence tool that provides access to reports and graphs based on engagement data.. For example, ID first_name for first name, and ID last_name for last name. See Predefined attributes in the Attributes Reference. | Add attributes in your project settings, then set them on your audience. |
| Custom | Customer | You can add any attribute type to your project. | Add attributes in your project settings, then set them on your audience. |
| Zero-copy data integration | Data partner | Directly access user data from external systems. The data remains in its original location instead of being copied or imported into Airship. | See Zero-copy data integration. |
Do not use custom attributes to identify or target a specific person. Use named userA contact identified with an ID you provide, such as a customer ID from your CRM. Associating channels with that ID maps multiple devices and channels to one individual. Each named user has a unique named user ID. instead.
Where attributes are stored
You can set attributes on a channel or a named user. An attribute on a named user applies across the contact’s associated channels. Those channels inherit it, and Airship removes it from a channel when you disassociate that channel. An attribute on a channel applies only to that channel. Named users do not inherit attributes from channels.
In most cases, set attributes on the named user so you can target the person on any of their channels. See Channels versus named users in Setting and removing attributes.
For the broader audience-data storage model, see Data storage in Your audience. For details on the segmentation systems and where custom attributes can be set, see Channel-level segmentation in Segmenting your audience.