SDK Privacy Methods

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.

The 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) 
    */ 
    val dataUseConsent = 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)
    */
    DataUseConsent dataUseConsent = new 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) 
    */ 
    val dataUseConsent = 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)
    */
    DataUseConsent dataUseConsent = new 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) 
    */ 
    val dataUseConsent = 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)
    */
    DataUseConsent dataUseConsent = new COPPA(true);
    Chartboost.addDataUseConsent(context, dataUseConsent);
    

Chartboost allows publishers to provide custom consent information, besides the predefined GDPR and CCPA values. Currently, the only custom consent values allowed are valid IAB’s U.S. Privacy String for the CCPA standard.

For example:

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

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

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