Search Unity

Analytics Initialization Timing

Discussion in 'Unity Analytics' started by unity_5476462C5C3D798D3AD5, Sep 10, 2021.

  1. unity_5476462C5C3D798D3AD5

    unity_5476462C5C3D798D3AD5

    Joined:
    Sep 2, 2021
    Posts:
    1
    Hello everyone,

    the bit is on the scripting API documentation page for the Analytics.limitUserTracking property:

    Code (CSharp):
    1. [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
    2.     static void InitStepOne()
    3.     {
    4.         Analytics.initializeOnStartup = false;
    5.     }
    Does this mean Unity Analytics is initialized after the first scene in the build is loaded? Is setting it BeforeSceneLoad the best time or are other options appropriate as well?

    Thanks in advance
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Feel free to test with your own game! It depends on your requirements, you can delay the initialization as you've pointed out. By default, Analytics should initialize immediately. To see the events that are actually being sent, along with their exact timing, you you want to use Charles Proxy https://support.unity.com/hc/en-us/articles/115002917683-Using-Charles-Proxy-with-Unity