SDK Privacy methods

🚧

Caution

  • Chartboost requires publishers to obtain consent from their users in order to process personal data and provide relevant ads.
  • Apps under the Google Play Designed for Families policy MUST set the COPPA privacy flag to true.
  • Review our COPPA FAQs for more information on behavior targeting.

addDataUseConsent is the new public API usage to set consent values. This new API provides user consent data for privacy laws currently in existence or future laws. Replaces CBPIDataUseConsent method.

GDPR

/**
* GDPR support settings:
* NON_BEHAVIORAL(0) means the user does not consent to targeting (Contextual ads)
* BEHAVIORAL(1) means the user consents (Behavioral and Contextual Ads)
*/
DataUseConsent dataUseConsent = new GDPR(GDPR.GDPR_CONSENT.BEHAVIORAL);
Chartboost.addDataUseConsent(context, dataUseConsent);
/** 
* GDPR support settings: 
* NON_BEHAVIORAL(0) means the user does not consent to targeting (Contextual ads) 
* BEHAVIORAL(1) means the user consents (Behavioral and Contextual Ads) 
*/ 
val dataUseConsent = GDPR(GDPR.GDPR_CONSENT.BEHAVIORAL)
Chartboost.addDataUseConsent(context, dataUseConsent)

CCPA

/**
* CCPA support settings:
* OPT_IN_SALE(1YN-) means the user consents (Behavioral and Contextual Ads)
* OPT_OUT_SALE(1NY-) means the user does not consent to targeting (Contextual ads)
*/
DataUseConsent dataUseConsent = new CCPA(CCPA.CCPA_CONSENT.OPT_IN_SALE);
Chartboost.addDataUseConsent(context, dataUseConsent);

/** 
* CCPA support settings: 
* OPT_IN_SALE(1YN-) means the user consents (Behavioral and Contextual Ads) 
* OPT_OUT_SALE(1NY-) means the user does not consent to targeting (Contextual ads) 
*/ 
val dataUseConsent = CCPA(CCPA.CCPA_CONSENT.OPT_IN_SALE) Chartboost.addDataUseConsent(context, dataUseConsent)

COPPA

If an app is child-directed, a value of true or false must be set to define proper behavior.

/**
* COPPA:
* true means that COPPA restrictions apply and the android advertising identifier is not transmitted. (Contextual ads)
* false means that COPPA restrictions do not apply. (Behavioral and Contextual Ads)
*/
DataUseConsent dataUseConsent = new COPPA(true);
Chartboost.addDataUseConsent(context, dataUseConsent);
/** 
* COPPA: 
* true means that COPPA restrictions apply and the android advertising identifier is not transmitted. (Contextual ads) 
* false means that COPPA restrictions do not apply. (Behavioral and Contextual Ads) 
*/ 
val dataUseConsent = COPPA(true) Chartboost.addDataUseConsent(context, dataUseConsent)

🚧

Caution

Apps under the Google Play Designed for Families policy MUST set the COPPA privacy flag to true in order to restrict transmitting the android advertising identifier.

Custom Consent

Chartboost allows publishers to provide custom consent information, besides the predefined GDPR and CCPA values.

For example:

DataUseConsent dataUseConsent = new Custom("name", "value");
Chartboost.addDataUseConsent(context, dataUseConsent);
val dataUseConsent = Custom("name", "value")
Chartboost.addDataUseConsent(context, dataUseConsent)

🚧

Caution

Currently, the only custom consent values allowed are valid IAB’s U.S. Privacy String for the CCPA standard.

Clear Data Use Consent

To clear any of the privacy data use consent, use the following method:

Chartboost.clearDataUseConsent(context, dataUseConsent.getPrivacyStandard());
Chartboost.clearDataUseConsent(context, dataUseConsent.privacyStandard)