User attributes

Learn how to define an audience based on the user's attributes.

The user variable gives you access to the user's profile, including interests, activities, statistics, and any custom attributes you have defined.

We store interests and activities as sets, so you do not have to worry about order or duplicates. To check if a user has a particular interest, you can use:

user's interest contains "marketing"
Try in Playground

To check if a user has one or more specific interests, use the contains either test:

user's interests contains either ["marketing", "sales"]
Try in Playground

To check if a user has all specified interests, you can use the contains all test:

user's interests contains all of ["marketing", "sales"]
Try in Playground

Conversely, you can check if a user does not have any of the specified interests by using the contains none test:

user's interests contains none of ["marketing", "sales"]
Try in Playground

Access to any other standard or custom attribute follows the same logic. For example, you can use the default attribute age to match young adults:

user's age is between 17 and 30
Try in Playground

The same applies to custom attributes. Suppose you have a custom attribute called score. You can check whether the user's score is above a threshold using:

user's score is greater than 10
Try in Playground

Or, if you prefer a shorter syntax, you can also write:

user's score > 10
Try in Playground

For more information on user variables, see the User section.