At a glance: Enrich your ability to segment users into relevant groups by adding your data about their characteristics into Audiences.
About user attributes
User attributes, unlike event-based data, are general characteristics that your users share with you. They can be static, like gender, age, birthday, and country; or dynamic, like the user score in a game.
User attribute data is:
- Updated using CSV file import or JSON via API.
- Stored in a hashed form.
- Available for use in any audience ruleset
User attribute data is not shared with advertising partners.
User attributes are housed at either the app-level or account-level as described in this article. If using app-level attributes, the account user requires app permission to manage and use the attributes.
The following scenario provides a detailed explanation of user attributes.
Scenario—app marketer requirements
You, the app marketer, are busy with the following:
- Maintaining 2 gaming apps: game_a and game_b.
- Launching game_c
- Targeting current app users with these user attributes:
- Favorite sport: Cricket
- Current game score: 15 or more in one of the current games
The table contains user-attribute data from your CRM. Audience rulesets need access to this data.
Use CRM data in rulesets
In Audiences, create user attributes (favorite sport and game score). This gives ruleset access to CRM data.
Scenario user attributes
Name | Format | Level |
---|---|---|
Game score | Number: Lets you set rules like 'ScoreGameB is greater than 29'. |
App-level: User's score is recorded for each game played. Meaning: ScoreGameA, ScoreGameB. |
Favorite sport |
String: Lets you set rules like 'whose favorite sport is tennis'. Note! Values are case-sensitive. |
Account-level: User's favorite sport is the same regardless of the app. Note! A user can have only 1 value associated with account-level attributes. |
User attributes in rulesets
User attributes act as filters in Audiences rulesets. This example uses criteria (favorite sport and game score) set by the marketer.
Implement user attributes
Set up, add, manage, and delete user attributes.
Set up
Prerequisite:
To manage app-level attributes, an account user must have app permission.
To set up user attributes follow these procedures:
Add
To add user attributes:
- In AppsFlyer, from the side menu, select Engage > Audiences.
- Click the User Attributes tab.
- Click Add user attribute.
- Complete the fields. Field characteristics are listed in the table that follows.
- Attribute name
- Format
- Level
- Click Save.
Field | Characteristics |
---|---|
Attribute name |
|
Format |
|
Level |
|
Manage
To manage user attributes, go to Audiences > User attributes tab.
Function | Description |
---|---|
Search and filter |
By attribute name, app name, and attribute level. |
Sort by | Click a column header to sort table rows. |
Import data | |
Change API import key |
To change the API import key:
Note! If scripts have embedded keys, make sure to update them with the new key. |
Delete
Only an admin user can delete an attribute.
To delete an attribute that is part of a ruleset:
- Remove the attribute from the ruleset.
- Delete the attribute.
Import data
Import field specifications
Field | Content | Format | Add data by CSV |
Remove data by CSV |
---|---|---|---|---|
device_id |
Includes 1 of these user IDs:
|
Text | Either device_id or customer_id is mandatory |
Either device_id or customer_id is mandatory
To remove existing data, don't send |
customer_id | Customer user ID | Text | Either device_id or customer_id is mandatory |
Either device_id or customer_id is mandatory
To remove existing data, don't send |
app_id |
App-level attribute: App ID as it displays in the dashboard. For iOS apps, include the prefix ID. Account-level attribute: Always populate with * |
Text | Mandatory | Mandatory |
attribute_key | User-attribute name, exactly as it displays on the user-attributes tab. | Text | Mandatory | Mandatory |
attribute_value |
Assigned value |
Text or number | Mandatory | Don't send |
Import data by CSV
User-attribute data is added or removed via a CSV file. The figure and example CSV file that follows, match the scenario describing the feature in this article.
CSV file requirements
- No header row
- Contains all the columns listed in the preceding table.
To import a CSV file:
- Go to Audiences > User attributes tab.
- Click Import data.
- Select CSV.
- Select either:
- Add data
- Remove data
- Choose a CSV file to import.
- Click Upload; an upload status message will appear.
Note: When importing user attributes, all known devices associated with a customer ID are also assigned the attribute. For example, if a user imported 10 devices (by customer_id) to attribute “Game score”, and one of the customer_ids is associated with 2 devices (i.e. 2 GAIDs with the same CUID), then this import will contain 11 user attribute records.
Import data by API
This import method requires a request URL and JSON with user-attribute data.
- In the dashboard, get the prepared API request calls and JSON template.
- Populate the JSON template with your data according to the field specifications.
To generate the API request URL and JSON template:
- Click Import data.
- Select API.
- Select an action:
- Update user-attributes: Overwrite or add.
- Remove user-attributes.
- Remove user data: Removes all data relating to a specific user. User is identified by their AppsFlyer ID.
- Remove app data: Removes all data at the app level.
- Copy the generated API request URL.
- Copy the generated API request body.
- Prepare the JSON (with its user-attribute data) using the specified JSON format. For account-level attributes set "app_ids": ["*"]
- Prepare the API call based on the URL and request body.
- Send the request programmatically.
https://hq1.appsflyer.com/api/user-attributes-import-api/set-user-data
{
"import_key": "c733e4d7-b538-4d12-a2ef-ffffffffffff",
"attributes_values": [
{
"device_id": "",
"customer_id": "",
"app_ids": [],
"attributes": [
{
"attribute_key": "",
"attribute_value": ""
}
]
}
]
}
Note
You must authenticate the request using an Authorization Bearer Header with an API token V2.0
{
"import_key": "c733e4d7-b538-4d12-a2ef-ffffffffffff",
"attributes_values": [
{
"device_id": "0bcfc579-f1f3-4452-9111f",
"customer_id": "2222222",
"app_ids": ["game.a.demo"],
"attributes": [
{
"attribute_key": "score",
"attribute_value": 5
}
,
{
"attribute_key": "favorite_sport",
"attribute_value": "cricket"
}
]
}
,
{
"device_id": "555555-d1d1-d1d1-555-fffffffff",
"customer_id": "111111",
"app_ids": ["game.a.demo"],
"attributes": [
{
"attribute_key": "order",
"attribute_value": 7
}
,
{
"attribute_key": "number",
"attribute_value": 8
}
]
}]
}
Example with a single device ID and multiple attribute keys and values
{
"import_key": "c733e4d7-b538-4d12-a2ef-ffffffffffff",
"attributes_values": [
{
"device_id": "0bcfc579-f1f3-4452-9111f",
"customer_id": "12345678",
"app_ids": ["game.a.demo"],
"attributes": [
{
"attribute_key": "score",
"attribute_value": 90
}
,
{
"attribute_key": "favorite-sport",
"attribute_value": "cricket"
}
,
{
"attribute_key": "orderNumber",
"attribute_value": 93
}
,
{
"attribute_key": "netPromoterScore",
"attribute_value": 94
}
]
}
]
}
Note: When importing user attributes, all known devices associated with a customer ID are also assigned the attribute. For example, if a user imported 10 devices (by customer_id) to attribute “Game score”, and one of the customer_ids is associated with 2 devices (i.e. 2 GAIDs with the same CUID), then this import will contain 11 user attribute records. CSV import limitations
Limitations
General limitations
- Only integer (whole) numbers are supported in CSV/API import data. Float type (decimal) numbers are not supported. Example: A "score" attribute value can be 90, but not 90.5.
- User-attribute data can't be printed or downloaded.
-
Attribute value limitations:
- No commas, dots, or other special characters inside attribute values.
- There is a length limitation of 40 characters for a string attribute value.
- Attribute values can't start with 0.
API import limitations
- Maximum 350 API requests per minute, 10K devices for flat payload (10K devices with one attribute, 5K devices with 2 attributes, etc.)
- Both
device_id
andcustomer_id
keys are mandatory for every import call. If you want to import attributes with only one of these identifiers, the call has to include the “header” of the other identifier with an empty string. For example, if you want to import attributes perdevice_id
and nocustomer_id
, the call should look like this:
"attributes_values": [
{
"device_id": "39e123.......",
"customer_id": "",
CSV import limitations
- When adding user attribute values, there is a maximum of 10 million rows per CSV file.