Search Unity

Question Disable UGS Analytics Entirely

Discussion in 'Unity Analytics' started by lkj_dpc, Feb 14, 2023.

  1. lkj_dpc

    lkj_dpc

    Joined:
    Aug 9, 2021
    Posts:
    4
    Hello,

    We develop a Unity product that ships on various platforms.

    We have recently upgraded from the Legacy analytics to UGS Analytics.

    It seems that even when we make no explicit calls to Unity.Services.Analytics.AnalyticsService, there is still network traffic to the following:
    - https://config.uca.cloud.unity3d.com
    - https://cdp.cloud.unity3d.com

    Because the majority of platforms we ship to disallow collecting user data we need to be able to completely disable the service.

    Please advise, thanks in advance~
     
  2. Julian-Unity3D

    Julian-Unity3D

    Unity Technologies

    Joined:
    Apr 28, 2022
    Posts:
    192
    You can disable analytics in your dashboard for your project
    Navigate to Analytics > Analytics Settings > Analytics enabled toggle.

    or you can use a code snippet:
    AnalyticsService.Instance.SetAnalyticsEnabled(false)
     
  3. lkj_dpc

    lkj_dpc

    Joined:
    Aug 9, 2021
    Posts:
    4
    Hi @Julian-Unity3D,
    Thanks so much for your prompt reply! <3

    As we are calling UnityServices.InitializeAsync explicitly from code during our runtime, I opted to just not call this method instead of using SetAnalyticsEnabled.

    Even so, I am still seeing network traffic to the above URLs.

    Can you tell me if it is possible to entirely disable UGS Analytics from sending any data across the network?
    If this is not possible then UGS Analytics is not an option for us.

    Thanks in advance
     
    Julian-Unity3D likes this.
  4. Julian-Unity3D

    Julian-Unity3D

    Unity Technologies

    Joined:
    Apr 28, 2022
    Posts:
    192
    Can you try this:

    Code (CSharp):
    1. // For the code disabling Legacy Analytics, or else the "Analytics" name won't be valid
    2. using UnityEngine.Analytics;
    3.  
    4. // For the code disabling Legacy Analytics, or else the "AnalyticsInstance" name won't be valid.
    5. using Unity.Services.Analytics;
    6.  
    7. // If you want to disable Analytics completely during runtime
    8.     public void DisableAnalyticsCompletely()
    9.     {
    10.         //this turns off legacy analytics
    11.         Analytics.enabled = false;
    12.         Analytics.deviceStatsEnabled = false;
    13.         PerformanceReporting.enabled = false;
    14.  
    15.        //UGS Analytics
    16.        AnalyticsService.Instance.SetAnalyticsEnabled(false)
    17.     }
    If you are using IAP then please be aware that IAP enables Analytics by default.
    If you have manually initialize UGS services but are not using it, then you should remove the initialization.