Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Closed] What is SetUserId and should I use it?

Discussion in 'Unity Analytics' started by skullthug, Apr 9, 2015.

Thread Status:
Not open for further replies.
  1. skullthug

    skullthug

    Joined:
    Oct 16, 2011
    Posts:
    202
    I haven't been able to find any info about what exactly SetUserId does. I expected to see it under the User Attributes section since it's right next to those methods.

    Other analytics packages tend to require you specify the user's unique identifier (via your own means), so I sort of assume this might be that. Is this something Unity takes care of automatically, or should I be using SetUserId to do this?
     
  2. angeloferro

    angeloferro

    Moderator

    Joined:
    Sep 12, 2014
    Posts:
    105
    Hey @skullthug!

    Developers can set their own UserID using SetUserID. Currently, it's not being utilized for anything, but we've included it so that once we have a raw data export feature available, you'll be able to tie events and data to the UserID that you set.

    Hope that helps clarify things :)
     
  3. skullthug

    skullthug

    Joined:
    Oct 16, 2011
    Posts:
    202
    Thanks @angeloferro
    So in that case, it would be in my best interest to continue with creating user unique identifiers and setting them for UA?
     
  4. angeloferro

    angeloferro

    Moderator

    Joined:
    Sep 12, 2014
    Posts:
    105
    Yup! If you have a way to keep track of the unique identifiers, then it is in your best interest to set them :)
     
  5. skullthug

    skullthug

    Joined:
    Oct 16, 2011
    Posts:
    202
    Good to know, thanks!
     
  6. PedroGV

    PedroGV

    Joined:
    Nov 1, 2010
    Posts:
    415
    @angeloferro: so with this unique identifiers, once the export feature is implemented, there would be no need to, say, include them in custom events? I mean like,

    Analytics.CustomEvent("Game", new Dictionary<string, object>
    {
    { "userID", userId },
    ...
    };

    Instead, we use Analytics.SetUserId(userId); right?
     
  7. mpinol

    mpinol

    Joined:
    Jul 29, 2015
    Posts:
    317
    Hi @PedroGV,

    That is correct. Once the export feature is implemented, and you use SetUserId, you will no longer need to include userId as a parameter for a custom event for you to tie a particular player to an event.
     
  8. PedroGV

    PedroGV

    Joined:
    Nov 1, 2010
    Posts:
    415
    Ah, ok.

    ETA for the implementation?
     
  9. mpinol

    mpinol

    Joined:
    Jul 29, 2015
    Posts:
    317
    @PedroGV,

    This is a feature we are currently working on but we have no concrete implementation date as of yet. Once it is available we will make an announcement on the forums.
     
  10. J_P_

    J_P_

    Joined:
    Jan 9, 2010
    Posts:
    1,027
    Are there plans to also use SetUserID to track "new users"? I noticed when people redownloaded my game (standalone builds), it seemed to count them as new users. Seems like that'd also mess with my retention stats. Some of my users alternate between windows and linux and it'd be nice if they were just counted as one user (my game is account based, so it'd be easy for me to use SetUserID).

    edit: posted an idea to Feedback https://feedback.unity3d.com/suggestions/utilize-setuserid-data-for-user-counts-new-users-etc
     
    Last edited: Jul 29, 2016
  11. erika_d

    erika_d

    Joined:
    Jan 20, 2016
    Posts:
    413
    Hi @JTown,

    Currently we don't use SetUserID for anything displayed on our dashboard, although it is something we've talked about in the past. Where it does come in handy is in our Raw Data Export feature, where it will show up and you can then run your own queries regarding it. This could probably include something like counting new users.

    You are correct that when we track unique users it is based on a randomly generated id that we create the first time an app is opened on a device, and therefore does not track users across devices.

    I notice you posted a link to a feedback idea on this topic on another thread which is great! Thanks very much for using our feedback page! For any other users interested in this feature, please vote for it using the link in the other post (http://forum.unity3d.com/threads/extracting-analytics-data.393208/#post-2728246)
     
  12. ShawnFeatherly

    ShawnFeatherly

    Joined:
    Feb 22, 2013
    Posts:
    57
    I'm still confused what UnityEngine.Analytics.Analytics.SetUserId() does. Where can I access or see UserIDs? Can I see what UserID has been set to in the Unity app itself or only in the Analytics dashboards' Raw Data Export?

    I'm asking because I'm trying to find the right way to have a cross device UserID without users needing to create accounts. I've been considering using a transactionID from an IAP UnityEngine.Purchasing.Product to use as a cross device UserID. It solves reinstalling to another device on the same platform. The problem is, that UserID would only exist if an IAP purchase is made. Leaving the likely majority of my users ID-less. Is there any kind of customer ID that is associated with IAP I can get without the user making a purchase?
     
  13. erika_d

    erika_d

    Joined:
    Jan 20, 2016
    Posts:
    413
    Hi @ShawnFeatherly,

    Thanks for your question, yeah it is kind of an odd situation since it's not displayed on the dashboard. SetUserId is only visible in Raw Data Export, it has no effect on the dashboard. In Raw Data you would be able to do queries, groupings, etc on the UserId you set.

    Using transactionIDs for userIDs might be tricky, since it's not really structured for that use, but it may be possible. As you mentioned, it would only work for users who had bought something, and furthermore, if you want to be able to look the transactionID up again in the future, they would probably have to buy a non-consumable, since consumed items get removed from the receipts. If you wanted to do it off consumed items, you'd have to mark them as pending and never mark them as completed, which means the app would have to be able to differentiate between truly pending products and this pending transactionID product.

    IAP doesn't have any other user-identifying parts, so unfortunately I can't think of anything else you could use that would include users not making a purchase.
     
  14. ykleban

    ykleban

    Joined:
    Feb 22, 2017
    Posts:
    15
    Hello!
    Is SetUserId still not used?
    Also, should I pass my own userId for Funnel stats?
    Thanks in advance.
     
  15. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @ykleban,

    SetUserID() will allow you to associate a custom user id with the Analytics-system-generated id. This is available for use with Raw Data Export. However, it is not exposed in the dashboard. Actually, no user-level data is exposed in the dashboard; the dashboard is designed for use with aggregate data.

    We don't encourage sending unique identifiers with your Analytics data because you will quickly run into the data processing limits:
    https://forum.unity3d.com/threads/new-data-processing-limits.450266/

    How were you planning to use user ids with funnels?
     
  16. ykleban

    ykleban

    Joined:
    Feb 22, 2017
    Posts:
    15
    Oh, nevermind. I did it for Tutorial steps without userids. Waiting for the first results.

    Also, I was just wondering if it may be possible to see a normal distribution (e.g. level score among users) in Unity Analytics?
     
  17. ykleban

    ykleban

    Joined:
    Feb 22, 2017
    Posts:
    15
    @ap-unity
    There're no my user ids after raw data export. What exactly should I do to get my user ids?
     
  18. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @ykleban,

    Unfortunately, we don't have a way to visualize data in this way.

    The custom user id (from SetUserID) will not show up in the Custom Event data set. It will only show up in the User Info data set. You will have to manually join these ids with the other data sets.
     
    creasaur likes this.
Thread Status:
Not open for further replies.