Opt-Out compliance

Important notice: UGS Analytics requires you to implement a privacy solution separate from Unity Ads. So, if you're using both Unity Ads and UGS Analytics, the Unity Ads opt-out mechanism will NOT apply to both services.

All version of the Analytics SDK and Unity Ads SDK provide compliance mechanisms consistent with known regulatory customers and guidance including General Data Protection Regulation (GDPR) and California Consumer Privacy Act (CCPA).

In regions that require you to provide an opt-out, you must provide your own logic to determine whether the player has opted out. You may call AnalyticsService.Instance.StartDataCollection() to start the SDK if the player hasn't opted out, otherwise you shouldn't call it and the SDK remains dormant.

async void Start()
{
   await UnityServices.InitializeAsync();
   
   if (playerHasOptedOut)
   {
		// Do nothing, leave the SDK off
   }
   else
   {
		AnalyticsService.Instance.StartDataCollection();
   }
}

Opting Out

If the user wants to later opt-out, they can use the same method for all applicable regulations by calling StopDataCollection().

public void OptOut()
{
	AnalyticsService.Instance.StopDataCollection();
}

You can also choose to request personal data deletion by calling RequestDataDeletion(), which triggers a purge of user data from the server.

public void RequestDataDeletion()
{
	AnalyticsService.Instance.RequestDataDeletion();
}

Privacy URL

Make sure you present the user with the privacy URL.

To get the privacy URL: Application.OpenURL(AnalyticsService.Instance.PrivacyUrl);

Opting back in

You can call the StartDataCollection() method at any time to activate or reactivate the SDK for data collection.