{# This content gets published to the following location: #} {# https://firebase.google.com/docs/analytics/user-properties?platform=flutter #}
{# TODO(markarndt): Sync all this content up with Analytics content consolidation plan. #}
Make sure that you've set up your project and can access {{analytics}} as described in Get Started with {{analytics}}.
You can set {{ analytics }} user properties to describe the users of your app. You can make use of user properties by creating custom definitions, then using them to apply comparisons in your reports or as audience evaluation criteria.
To set a user property, follow these steps:
- Create a custom definition for the user property in the Custom Definitions page{: .external} of {{analytics}} in the {{name_appmanager}}. For more information, see Custom dimensions and metrics.
- Set a user property in your app with the
setUserProperty()
method.
The following example adds a hypothetical favorite food property, which
assigns the value in favoriteFood
to the active user:
await FirebaseAnalytics.instance
.setUserProperty({
name: 'favorite_food',
value: favoriteFood,
});