Documentation

Support

Key changes in the new Unity Ads privacy API

This guide explains how LevelPlay mediation users and direct Unity Ads integrations can upgrade to the new beta privacy APIs, outlining the API changes and which new beta APIs to use.
Read time 2 minutesLast updated 7 days ago

Note
The current version of the Unity Ads SDK privacy API is in a beta release. The features and documentation might change between now and the next release.
Unity Ads SDK 4.17.0 introduces new public privacy APIs in beta, currently used only through the LevelPlay mediation adapter. This guide is for developers integrating Unity Ads SDK 4.17.0 directly with the LevelPlay mediation adapter.

Upgrade to Unity Ads SDK 4.17.0

If you’re a LevelPlay mediation user using the LevelPlay mediation adapter, all privacy and consent handling is managed directly through the adapter. The recommended best practice is to review and follow the LevelPlay privacy regulation advanced settings documentation for your platform (Android, iOS, Unity, Adobe Air, Flutter, or React Native).If your integration correctly sets consent flags in the appropriate scenarios, no further action from you is needed.
Important
As of SDK version 4.17.0, the beta Privacy API enforces one authoritative signal per privacy framework, either the opt-in consent signal
setUserConsent
for opt-in privacy frameworks or the opt-out signal
setUserOptOut
for opt-out privacy frameworks. Refer to Set the correct consent signal mappings to see which method is appropriate for which privacy framework. Signals from the non‑applicable API are not applied and the framework’s default behavior remains in effect.
It’s your responsibility to ensure you have reviewed and fulfilled the Prerequisite conditions and using the latest version of the Unity Ads SDK when enabling developer consent.

What’s changing

Review the following table to determine which Metadata privacy API methods you must update to use the new beta privacy API.

Former privacy API

New privacy API to use instead

Description

gdpr.consent
setUserConsent
Covers consent for opt-in frameworks.
privacy.consent
setUserOptOut
Covers consent for opt-out frameworks.
user.nonbehavioral
setNonBehavioral
Covers consent for age-restricted frameworks.
pipl.consent
Not applicable.Deprecated API, should be removed.
privacy.useroveragelimit
Not applicable.Deprecated API, should be removed.
Refer to Use the new beta privacy APIs on guidance for implementation.