Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Setting up user attributes and UserID

Discussion in 'Unity Analytics' started by SeashellsRacer, Apr 10, 2015.

  1. SeashellsRacer


    Oct 16, 2014
    Trying to set up some user attributes but it doesn't seem to be working. specifically gender. Age has issues too but I think they are related. Does the order in which you set the attributes, initialize analytics, set userid matter?

    All current Users segment has members but for some reason gender doesn't have any members. Our custom age segments don't seem to be working either. However the built in age segments work fine.

    Here's how I kinda have it setup.
    Code (CSharp):
    2. if(!isInitDataSet)
    3.         UnityAnalytics.StartSDK (ANALYTICS_ID);
    5. if(isLoggingIn) //check to make sure they are playing with a logged in account not a quick game
    6. {
    7.         UnityAnalytics.SetUserGender(sex);
    8.         UnityAnalytics.SetUserBirthYear(birthyear);
    9.         UnityAnalytics.SetUserId(PlayerDatabase.PlayerID);
    10. }
    11. else
    12. {
    13.         UnityAnalytics.SetUserGender(SexEnum.U);
    14.         UnityAnalytics.SetUserBirthYear(1900);
    15.         UnityAnalytics.SetUserId(SystemInfo.UniqueDeviceIdentifier);
    16. }
    In our game you can have up to 3 accounts per device. PlayerDatabase.PlayerID retrieves a unique id created for that player from our own server.
  2. sschan


    Unity Technologies

    Oct 8, 2014
    Hi @SeashellsRacer - be on the lookout for a private message from me. I need to ask you some additional details. Thanks!