Skip to content

Analytics Set User Properties

Eoin Landy edited this page Jan 30, 2020 · 2 revisions

The contents of this page are based on the original Firebase Documentation

User properties are attributes you define to describe segments of your user base, such as language preference or geographic location.

Analytics automatically logs some user properties; you don't need to add any code to enable them. If you need to collect additional data, you can set up to 25 different Analytics User Properties per project.

Set user properties

You can set Analytics user properties to describe the users of your app. You can analyze behaviors of various user segments by applying these properties as filters to your reports.

Set a user property as follows:

  1. Register the property in the Analytics page of the Firebase console.
  2. Add code to set an Analytics user property with the setUserProperty() method. You can use the name and value of your choosing for each property.

The following example shows adding a hypothetical favorite food property, which assigns the value in the string food to the active user:

analytics.setUserProperty("favorite_food", food);

Note: Once the property is registered, it can take several hours for data collected with the property to be included in reports. When the new data is available, the user property can be used as a report filter or audience definition.

Clone this wiki locally