Documentation

Support

Analytics

Analytics

Opt-in compliance

Learn how to request player consent for data collection in regions with opt-in requirements, such as China's Personal Information Protection Law.
Read time 2 minutesLast updated 21 hours ago

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.

Unity 6.2 and later with Analytics SDK 6.1 and later

The Analytics SDK is controlled by the Developer Data framework
EndUserConsent
API, present in the Unity Engine from 6.2 onwards. To start or stop data collection, you must set the consent status for
AnalyticsIntent
to
Granted
or
Revoked
respectively.
For specific information about granting consent with the
EndUserConsent
API, refer to Developer Data framework.

Unity 6.1 and earlier, or Analytics SDK 6.0 and earlier

If consent is given call
AnalyticsService.Instance.StartDataCollection()
to enable the collection of their data. If consent is not given, don't call this method and the SDK will continue to ignore events.

PIPL consent

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. Please visit Unity's legal site for more information on Unity's approach to PIPL. 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
StartDataCollection()
method as seen below to signal that consent has been provided.
async void Start(){ await UnityServices.InitializeAsync(); ShowPIPLConsentFlow();}public void PIPLConsentGiven(){ AnalyticsService.Instance.StartDataCollection();}