NOTE:
Important notice: The following guide relates to version 5.1.0 of the SDK and below. It's recommended that you uprade to the latest version as soon as possible. For more information, see the Privacy Overview.
As of version 5.0.0, the Analytics SDK does not collect any personal data by default. You are responsible for determining what data privacy legislation affects the player and when it is appropriate for you to enable data collection by the SDK (i.e. have the player’s consent for an opt-in legislation, or that the player has not denied consent for an opt-out legislation). If you are not using SDK version 5.0.0 or greater, it is strongly recommended that you upgrade as soon as possible.

GDPR & CCPA Consent
For GDPR and CCPA, startDataCollection
will start the event recording process, but you should offer the user a method to always Opt-Out.
To use startDataCollection
in GDPR and CCPA regions you can use this function:
async void Start()
{
await UnityServices.InitializeAsync();
if (playerHasOptedOut)
{
// Do nothing, leave the SDK off
}
else
{
AnalyticsService.Instance.StartDataCollection()
}
}
More information regarding GDPR and CCPA Consent is in the documentation found here: Consent (Opt-in) vs Opt-out
PIPL Consent
PIPL is an opt-in based legislation. You still need startDataCollection
for PIPL legislation which is similar to GDPR and CCPA. 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();
}
Please visit Unity's legal site for more information on Unity's approach to PIPL.
Opt-Out
If the user wants to later opt-out they can do so using the same method for all applicable regulations by using the public void OptOut().
public void OptOut()
{
AnalyticsService.Instance.StopDataCollection();
}
Data Deletion
Call RequestDataDeletion
to request personal data deletion, which triggers a purge of user data from the server.
public void RequestDataDeletion()
{
AnalyticsService.Instance.RequestDataDeletion();
}
Please note: This functionality only applies to this service and the Push Notification Service. If you are using other services which collect app user personal data you will need to review that service's documentation for how it handles data deletion requests. To delete the Player ID created by the Unity Authentication SDK (if enabled), please use the Authentication API.
Opt-BackIn
Call the startDataCollection
method at any time to activate or reactivate the SDK for data collection.