Migrate to Unity 6.2 with Analytics SDK 6.1.0
Update your consent management code to use the Developer Data framework in Unity 6.2 with Analytics Software Development Kit 6.1.0.
Read time 1 minuteLast updated 19 hours ago
Follow this guide if you're upgrading to Unity 6.2 with Analytics SDK 6.1.0. Unity 6.2 introduces the Developer Data framework to manage player consent. This framework uses the Unity Engine's
EndUserConsentStartDataCollection()StopDataCollection()
You no longer need to manually activate the Analytics SDK after calling
UnityServices.InitializeAsync()StartDataCollection()StopDataCollection()EndUserConsent.SetUserConsent(...)AnalyticsIntentTo learn more about managing consent with the// ... ask for consent...ConsentState consentState = EndUserConsent.GetConsentState();if (userGaveConsent){ consentState.AnalyticsIntent = ConsentStatus.Granted;}else{ consentState.AnalyticsIntent = ConsentStatus.Denied;}EndUserConsent.SetConsentState(consentState);
EndUserConsentUnityServices.InitializeAsync()AnalyticsIntentGrantedAnalyticsIntentGrantedUnityServices.InitializeAsync()AnalyticsIntentGrantedRequest data deletion
The Analytics SDK still controls data deletion requests, using the existingRequestDataDeletion()EndUserConsentConsentState consentState = EndUserConsent.GetConsentState();consentState.AnalyticsIntent = ConsentStatus.Denied;EndUserConsent.SetConsentState(consentState);AnalyticsService.Instance.RequestDataDeletion();