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.

  • 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.

  • Select one of the items below as the GdprType.

GDPR type

Description

gdprTypePopupLocation

Show the consent popup depending on the region (EU region).

gdprTypePopupDebug

Show the consent popup regardless of region for testing purposes (DEBUG).

gdprTypeDirectNotRequired

Regions where consent is not required (non-EU regions).

gdprTypeDirectDenied

The user has refused the collection and use of personal data.

gdprTypeDirectConfirm

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.

  • If you set the GDPR type to gdprTypePopupLocation, EU users can decide their consent through the GDPR Consent UI based on their access country.

  • If you set GdprType to gdprTypePopupDebug, the consent screen can be shown regardless of the user’s country.

AdxInitResult adxInitResult = await AdxSdk.initialize(
                                "<ADX_APP_ID>", 
                                AdxCommon.gdprTypePopupLocation, 
                                ["<TEST_DEVICE_ID>"]);

To test the AdMob UMP GDPR consent screen, the following two steps are required: 1) Go to the AdMob dashboard (https://apps.admob.com) and follow the GDPR message creation guide to create and publish the message: https://support.google.com/admob/answer/10113207?hl=en


  • Android 2) Check the device ID in the log output. Enter this identifier string as the last parameter and set gdprTypePopupDebug. Use new ConsentDebugSettings.Builder().addTestDeviceHashedId("33BE2250B43518CCDA7DE426D04EE231") to set this as a debug device.


  • iOS 2) When the iOS app is installed on a device, the following message is displayed in the Xcode console. Enter this identifier string as the last parameter and set gdprTypePopupDebug.


<UMP GDPR Consent Screen>

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.

  • If consent is not required outside the European Economic Area (EEA), set the GDPR type to gdprTypeDirectNotRequired.

AdxInitResult adxInitResult = await AdxSdk.initialize(
                                "<ADX_APP_ID>", 
                                AdxCommon.gdprTypeDirectNotRequired, 
                                []);

2. ConsentState

GDPR consent can have one of the following four states.

int consentState = adxInitResult.consent

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.

Last updated

Was this helpful?