Unity Analytics collects data even though it is disabled


I use IAP in my app.
For privacy/legal reasons I want to disable Unity analytics or at least the collection of data.

So far I have the following code when starting the app:

    private void Awake() {
        Analytics.initializeOnStartup = false;
        Analytics.enabled = false;
        PerformanceReporting.enabled = false;
        Analytics.limitUserTracking = true;
        Analytics.deviceStatsEnabled = false;
        CrashReportHandler.enableCaptureExceptions = false;

With the new update I have added Unity Ads. I have introduced this update as an internal and closed test.
There are not more than 10 testers.

Now I have statistics in my Unity Dashboard.
Why are they there now?

And why does it say 291 monthly new users, even though I don’t have more than 10 testers?

There aren’t any Ads anywhere on the Internet that don’t come with Analytics. Just saying that this seems logical. Try removing ads for a test and see if the disabled analytics sticks. But once you add ads you got analytics, I’m almost certain.

The ads have a built-in data protection popup and an opt-out option. Is that enough for the analytics or do I have to write something extra in the privacy policy and add a button to delete data in the app?

Hey PandaDevelopments,

The Analytics calls in the code snippet you shared refer to the old Legacy Analytics SDK. However, since version 4.2.0, the IAP SDK now uses the new Unity Gaming Services Analytics package. So, it is most likely that your calls to disable analytics won't be having any impact.

The current version of the IAP SDK as of 8 Jul 2024 is IAP 4.12.1-pre.4 and the latest version of Analytics is 5.1.1

With these versions, there are 3 ways to enable / disable Analytics reporting from the IAP SDK.

  • The IAP Catalog panel in Editor contains an 'Automatically Initialize Unity Gaming Services' checkbox, if this is set to Enabled the IAP SDK will automatically record analytics events.
  • If you are initializing Unity Gaming Services in code you need to explicitialy call AnalyticsService.Instance.StartDataCollection(); to start collecting Analytics data, leave this out if you don't want to record analytics events.
  • You can also disable Analytics data from the Analytics Settings page on your Unity Dashboard.