Initialize
0. GDPR (General Data Protection Regulation)
The GDPR is the European Union's (hereinafter 'EU') data protection law, and service providers must obtain user consent regarding the collection and use of personal data of EU users or equivalent information. This is the procedure required for GDPR compliance and for ad network operations under the regulation.
1. Initialize & GDPR Content UI
On initialization, it provides the necessary features to obtain and process GDPR consent from users in the European Economic Area (EEA). In the AppDelegate, call the initialization function before making any ad-related requests.
In the ADX SDK, you can handle GDPR consent from users.
As of January 16, 2024, IAB Europe requires that consent management be handled through a Consent Management Platform (CMP) certified by platform vendors. Therefore, the GDPR consent screen previously provided internally by the Unity ADX SDK is no longer supported, and GDPR consent must now be managed through AdMob UMP (User Messaging Platform).
If you are servicing, or plan to service, an application in the European Economic Area (EEA), follow the instructions in this document to configure the UMP (User Messaging Platform).
Use the ADX App ID issued by ADX in place of "
<ADX_APP_ID>
".SDK initialization should be called only once when the app launches and ad requests should be made after SDK initialization is complete.
Do not request ads until the
OnADXConsentCompleted
callback has been received.
Select one of the items below as the
GdprType
.
GDPR Type
Description
POPUP_LOCATION
Show the consent popup depending on the region (EU region).
POPUP_DEBUG
Show the consent popup regardless of region for testing purposes (DEBUG).
DIRECT_NOT_REQUIRED
Regions where consent is not required (non-EU regions).
DIRECT_DENIED
The user has refused the collection and use of personal data.
DIRECT_CONFIRM
The user has agreed to the collection and use of personal data.
Case 1. Display the GDPR consent screen for users in the EEA
Provides a consent screen that allows users in the European Economic Area (EEA) to choose whether to give consent.
The functionality that allows users in the EEA to choose consent is handled by AdMob UMP (User Messaging Platform).
If you set
GdprType
toPOPUP_LOCATION
in ADXConfiguration, EU users can decide whether to give consent via the GDPR Consent UI based on their access country.If you set
GdprType
toPOPUP_DEBUG
, the consent screen will be shown regardless of the user’s access country, allowing you to test the UI.
ADXConfiguration adxConfiguration = new ADXConfiguration.Builder()
.SetAppId("<ADX_APP_ID>")
.SetTestDevices(new List<string>() {"<TEST_DEVICE_ID>"})
.SetGdprType(GdprType.POPUP_LOCATION).Build();
AdxSDK.Initialize(adxConfiguration, adxConsentState => {
Debug.Log(":::onADXConsentCompleted : " + adxConsentState);
});

Case 2. Direct Consent State
If your app does not have users in the European Economic Area (EEA) or does not collect personal data as defined by GDPR (e.g., account registration within the app), you must handle consent manually.
For regions outside the European Economic Area (EEA) where consent is not required, set
GdprType
toDIRECT_NOT_REQUIRED
inADXConfiguration
.
In UMP, GDPR and IDFA (Identifier for Advertisers) access permissions are managed together. If GdprType
is set to DIRECT_NOT_REQUIRED
, access to IDFA will not be granted. In this case, the ATT (App Tracking Transparency) consent request must be handled manually using programming code.
ADXConfiguration adxConfiguration = new ADXConfiguration.Builder()
.SetAppId("<ADX_APP_ID>")
.SetTestDevices(new List<string>() {"<TEST_DEVICE_ID>"})
.SetGdprType(GdprType.DIRECT_NOT_REQUIRED).Build();
AdxSDK.Initialize(adxConfiguration, adxConsentState => {
Debug.Log(":::onADXConsentCompleted : " + adxConsentState);
});
2. ConsentState
GDPR consent can have one of the following four states.
State
Description
0
Users with no consent status: personalized ads will not be shown.
1
Regions where consent is not required (non-EU regions): personalized ads will be shown.
2
Users who have refused the collection and use of personal data: personalized ads will not be shown.
3
Users who have agreed to the collection and use of personal data: personalized ads will be shown.
To check or update the consent state, use the following functions provided by ADXGDPRManager
.
// Checks the consent state of the user set in ADXGdprManager.
ADXGDPRManager.GetConsentState();
// Manually updates the consent state.
ADXGDPRManager.SetConsentState(consentState);
3. Redisplay the GDPR consent screen
You can redisplay the GDPR consent screen to the user, allowing the consent state to be updated.
AdxSDK.ShowGDPRForm((bool result) => {
});
4. Privacy Policy
You can access the URL of ADX’s Privacy Policy by calling GetPrivacyPolicyURL()
in ADXGDPRManager
.
ADXGDPRManager.GetPrivacyPolicyURL();
5. Enable Debugging Logging
To verify proper integration and mediation during QA, the following settings must be applied before calling the initialization function.
AdxSDK.SetLogEnable(true);
6. iOS App Pause Functionality (Full-Screen Ads)
If you need to pause the iOS app while full-screen ads, such as interstitial or rewarded ads, are being displayed, the following method must be applied.
AdxSDK.SetiOSAppPauseForFullScreenAd(true);
7. Android Main Thread Handling
Accessing resources through ad callbacks on Android devices may result in main thread-related errors, such as:
“can only be called from the main thread”
To resolve this, ensure that the relevant logic is executed on the main thread using either Update()
or AdxSDK.ExecuteMainThread().
AdxSDK.ExecuteMainThread(() => {
});
8. Child-Directed Settings
If your content is intended for children under COPPA regulations or targets users below the consent age in the European Economic Area (EEA), you must configure AdMob targeting settings before calling the initialization function. For more details, refer to AdMob Targeting: https://developers.google.com/admob/unity/targeting?hl=en
Last updated
Was this helpful?