Opt-In compliance

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

Some jurisdictions, including China, where PIPL applies (more information below), are opt-in based legislations, regardless of whether the analytics are privacy invasive or not. For China specifically, players need to opt in to both the collection of their data and the transferring of their data outside of China. If a user is currently in China, you must request user consent. If consent is given call AnalyticsService.Instance.StartDataCollection() to enable the collection of their data.

Legacy versions (below version 3.0) of the SDK no longer collect data from users in impacted regions, strictly based on geographic location. No aggregated historical data is lost, but you will see a decline in core metrics such as DAU if you have players in these regions.

Versions 3.0 and 4.0 offer developers functions to pass the appropriate consent flags to the Analytics package for players to opt in to data collection. These functions have been deprecated as of 5.0 and are no longer recommended for use.

Note: If you're using the REST API, refer to Sending PIPL consents.

China’s data privacy law - Personal Information Protection Law (“PIPL”) - came into effect on 1 November 2021. Personal information is data that can identify a person, such as name or address, and is stored electronically or otherwise. Sensitive personal information refers to biometrics, gender identity, religious beliefs, medical history, finance, and any personal information of minors under fourteen years.

PIPL is an opt-in based legislation. You're obligated to ask the user for their consent before any other actions are allowed in the SDK. Call the OptIn() method as seen below to signal that consent has been provided.

async void Start()
{
   await UnityServices.InitializeAsync();
   
   ShowPIPLConsentFlow();
}
public void PIPLConsentGiven()
{
	AnalyticsService.Instance.StartDataCollection();
}

Please visit Unity's legal site for more information on Unity's approach to PIPL.

Opting out

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

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

Call RequestDataDeletion() to request personal data deletion, which triggers a purge of user data from the server.

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

Privacy URL

You also need to present the user with the privacy URL.

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

Opting back in

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