Search Unity

When are UserInfo events sent?

Discussion in 'Unity Analytics' started by Spartan301, Sep 28, 2017.

  1. Spartan301

    Spartan301

    Joined:
    Aug 31, 2011
    Posts:
    20
    Hello, I was wondering what triggers a UserInfo event to be sent by a build? Is it every time it is opened?

    The reason I ask is because I would like to mark test devices by using Analytics.SetUserId so that we can filter test data out from our live data, and we need the UserInfo event to associate the custom_userid that we set with the userid that is tied to the actual custom events.
     
  2. ap-unity

    ap-unity

    Unity Technologies

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

    UserInfo events are not triggered automatically. You would have to call one of the methods manually:
    https://docs.unity3d.com/Manual/UnityAnalyticsUserAttributes.html
    https://docs.unity3d.com/ScriptReference/Analytics.Analytics.SetUserId.html

    However, I don't think you'll need that in your case.

    The Editor will send analytics events as if it were any other device. This is useful to confirm that you have analytics enabled and your events are sending correctly, but I can understand if you don't need every game_over event when your balancing the difficulty.

    In this case, you should consider using the Analytics.enabled property (available in 5.6+) in combination with Debug.isDebugBuild or the UNITY_EDITOR preprocessor directive.
    https://docs.unity3d.com/ScriptReference/Analytics.Analytics-enabled.html