Android GDPR Guide [ENG] - bidmad/Bidmad-Android GitHub Wiki

Requesting Consent from European Users(GDPR)

Interface for GDPR (EU General Data Protection Regulation) provided by AdNetwork SDK linked with Bidmad is provided. As there are different interfaces depending on the Ad Network, Bidmad provide a total of two interfaces, so please use the interface that suits your network.

*Some networks do not provide the GDPR Interface, so please inquire before applying the GDPR.


Google GDPR Interface

Google sets up a user consent pop-up through the Funding Choices platform and exposes it to users through the UMP SDK. Google GDPR Interface is a wrapper interface for UMP SDK provided by Google (Admob / Admanager). If you applied Google GDPR through UMP SDK before Bidmad, you don't need to change to the interface provided by Bidmad.

After creating the user consent pop-up form in Funding Choices, follow the instructions below to request the user consent.

  1. Object initialization and callback listener settings

    Initialize the object and set up a callback listener to call the function and receive the response result.

GoogleGDPRConsent googleGDPRConsent = new GoogleGDPRConsent(this); //this = Activity
googleGDPRConsent.setListener(new GoogleGDPRListener() {
    @Override
    public void onConsentInfoUpdateSuccess() {}
    @Override
    public void onConsentInfoUpdateFailure(FormError formError) {}
    @Override
    public void onConsentFormLoadSuccess() {}
    @Override
    public void onConsentFormLoadFailure(FormError formError) {}
    @Override
    public void onConsentFormDismissed(FormError formError) {}
});
  1. Request up-to-date consent information

    Request an update to user consent information to see if user consent is required. If you receive a success response, it is recommended to call is Consent Form Available to check if the form is accessible and then call loadForm.

googleGDPRConsent.requestConsentInfoUpdate();

....
@Override
public void onConsentInfoUpdateSuccess() {
  // The consent information state was updated.
  if(googleGDPRConsent.isConsentFormAvailable()) // You are now ready to check if a form is available.
    googleGDPRConsent.loadForm();
}

@Override
public void onConsentInfoUpdateFailure(FormError formError) {
  Log.d("GDPR","onConsentInfoUpdateFailure" + formError.getMessage());
}
...

  1. Load Form

    Bring up the form set up by Funding Choices. If you receive a successful response, it is recommended to call getConsentStatus to check if the user's consent is required, and then display a pop-up.

googleGDPRConsent.loadForm();
....
@Override
public void onConsentFormLoadSuccess() {
  if(googleGDPRConsent.getConsentStatus() == GoogleGDPRConsent.ConsentStatus.REQUIRED) // If user consent to the GDPR is required.
    googleGDPRConsent.showForm(); 
}

@Override
public void onConsentFormLoadFailure(FormError formError) {
  Log.d("GDPR","onConsentFormLoadFailure = " + formError.getMessage());
}
....
  1. Show Popup

    Pops up a form to obtain consent from the user.

googleGDPRConsent.showForm();
....
@Override
public void onConsentFormDismissed(FormError formError) { //FormError Nullable
  Log.d("bidmad","onConsentFormDismissed");

  if(formError != null)
    Log.d("bidmad","FormError = " + formError.getErrorCode());
}
....

*Testing If testing is needed, set the debugging mode by calling setDebug(TEST-DEVICE-HASHED-ID, isEEA). TEST-DEVICE-HASHED-ID can be checked in Log.

UserMessagingPlatform: Use new ConsentDebugSettings.Builder().addTestDeviceHashedId("TEST-DEVICE-HASHED-ID") to set this as a debug device.

You can reset the test result by calling the reset function.

GoogleGDPRConsent googleGDPRConsent = new GoogleGDPRConsent(this); //this = Activity
...
googleGDPRConsent.setDebug("TEST-DEVICE-HASHED-ID", true); //true is EEA, false is not EEA
googleGDPRConsent.reset();
...
googleGDPRConsent.requestConsentInfoUpdate();

GDPR Interface

This is an interface to the GDPR provided by other ad networks excluding Google (Admob / Admanager). In other ad networks, the interface is configured to deliver the value of the user consent result (agree / disagree) to the SDK when requesting an advertisement.The GDPR Interface provided by Bidmad delivers the result of user consent to each Ad Network's SDK.

If you want to use the GDPR Interface, develop a pop-up to obtain user consent and then call the GDPR Interface according to the pop-up result.

Consent consent = new Consent(this, true); // this = context, true is EEA, false is not EEA
consent.setGdprConsent(true); //Set user GDPR consent result
consent.getGdprConsent(); //Get user GDPR consent result, GDPRConsentStatus[YES(1),NO(0),UNKWON(-1),UNUSE(-2)]