Legacy Documentation: Version 5.2
Receipt Verification
Unity Analytics 5.2

User Attributes

Unity Analytics offers the ability to track user demographics. This provides you with robust ways to filter your data to look at different user segments. This information is pulled from player information entered at signup or from third-party SDKs (e.g., Facebook ).

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

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

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

For example:

  Gender gender = Gender.Female;
  UnityAnalytics.SetUserGender(gender);

  int birthYear = 2014;
  UnityAnalytics.SetUserBirthYear(birthYear);

Press Play

To send test User Attribute data to our servers and validate your integration, trigger your User Attribute during Editor Play mode. If integration is successful, your test data will display in the table below.

Validate

Receipt Verification
Unity Analytics 5.2
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961