Legacy Documentation: Version 5.1
Custom Events (recommended) (SDK)
Unity Analytics Upgrade Instructions

User Attributes (recommended) (SDK)

Depending on the genre of your project, creating custom segments around gender and age of your users may interest you. Whether you’re receiving this information on signup of your project, or from a third-party SDK, eg: Facebook, you can send these demographics to Unity Analytics.

// Reference the Unity Analytics SDK package
  using UnityEngine.Cloud.Analytics;

  // Use this call to designate the user gender
  UnityAnalytics.SetUserGender(SexEnum gender);

  // Use this call to designate the user birth year
  UnityAnalytics.SetUserBirthYear(int birthYear);
Name Type Description
gender enum Gender of used can be “Female”, “Male or ’Unknown”.
birthYear int Birth year of user. Must be 4-digit year format only.

For example:

 SexEnum gender = SexEnum.F;
  UnityAnalytics.SetUserGender(gender);

  int birthYear = 2014;
  UnityAnalytics.SetUserBirthYear(birthYear);
Custom Events (recommended) (SDK)
Unity Analytics Upgrade Instructions