Search Unity

  1. Check out our Unite Austin 2017 YouTube playlist to catch up on what you missed. More videos coming soon.
    Dismiss Notice
  2. Unity 2017.2 is now released.
    Dismiss Notice
  3. The Unity Gear Store is here to help you look great at your next meetup, user group or conference. With all new Unity apparel, stickers and more!
    Dismiss Notice
  4. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice
  6. Unity 2017.3 beta is now available for download.
    Dismiss Notice

How Unity Analytics recognises returning users (and count/ignore them in DAU)?

Discussion in 'Unity Analytics' started by cr4y, Jan 6, 2016.

  1. cr4y

    cr4y

    Joined:
    Jul 12, 2012
    Posts:
    30
    Hi,

    I try to understand and cannot find anywhere something really basic:
    I believe that when I run StartSDK(string appId) function, it connects with Unity Cloud and collects information about new user.
    I also believe that Unity Cloud somehow is able to distinguish returning user. So if one person is playing game 5 times per day, DAU=1, and total playtime is equal sum of play periods. Am I right?

    How does Unity recognise returning users? Does it use usernames set by SetUserId(string)? Will it work correctly without this function? Does it compare IP numbers or something?

    Thanks in advance for any help,
    Kris
     
    silviu-georgian77 likes this.
  2. mpinol

    mpinol

    Unity Technologies

    Joined:
    Jul 29, 2015
    Posts:
    315
    Hi @cr4y,

    The first time your app is launched a unique userid is created and stored locally on the device. This userid is how we distinguish users from one another. This approach does have one catch though. Since the id is stored locally on the device, if the user uninstalls or deletes the file that contains the userid, the next time the app is launched a new userid will be generated and they will be counted as a new user.

    The SetUserId() function is a way for you to set a particular userid for your own reference. Using the function to set your own userid is most useful when paired with the Raw Data Export feature that we are working on. This would allow you to identify users according to the userid that you set as opposed to using the generated Analytics userid.
     
    silviu-georgian77 and cr4y like this.
  3. cr4y

    cr4y

    Joined:
    Jul 12, 2012
    Posts:
    30
    Thanks a lot for explanation!
     
  4. AS-Andrew

    AS-Andrew

    Joined:
    May 23, 2016
    Posts:
    3
    If you push an update through steam and users download update, does that generate a new userid?
     
  5. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    293
    Updates and reinstalls (by the same user on the same device) do not count as a new user.
     
    AS-Andrew likes this.
  6. AS-Andrew

    AS-Andrew

    Joined:
    May 23, 2016
    Posts:
    3
    awesome! thanks for the quick response.
     
  7. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    293
    Slight correction: Updates don't count as new users, but reinstalls will.
     
  8. wwcolter

    wwcolter

    Joined:
    Nov 4, 2016
    Posts:
    4
    Jeff - when using Unity in the editor, how do we force new users? I tried deleting the cached data in `AppData\LocalLow\AppName\` (Windows) and playing again but that doesn't seem to do the trick.
     
  9. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    293
    We store the info in the Registry under HKEY_CURRENT_USER\SOFTWARE\Unity\UnityEditor\[company]\[project]

    This is where we store PlayerPrefs. You can find the unique key in the registry, then call DeleteKey on that key.

    https://docs.unity3d.com/ScriptReference/PlayerPrefs.html

    You can also call PlayerPrefs.DeleteAll, but use with caution.
     
    wwcolter likes this.