SDK Privacy Methods
Warning
- Chartboost requires that publishers obtain consent from their users to be able to process personal data and provide relevant ads.
- Review our COPPA FAQs for more information on behavior targeting.
GDPR
To set GDPR consent:
/**
* GDPR support settings:
* nonbehavioral means the user does not consent to targeting (Contextual ads)
* behavioral means the user consents (Behavioral and Contextual Ads)
*/
Chartboost.addDataUseConsent(CHBDataUseConsent.GDPR(CHBDataUseConsent.GDPR.Consent.behavioral))
/**
* GDPR support settings:
* CHBGDPRConsentNonBehavioral means the user does not consent to targeting (Contextual ads)
* CHBGDPRConsentBehavioral means the user consents (Behavioral and Contextual Ads)
*/
[Chartboost addDataUseConsent:[CHBGDPRDataUseConsent gdprConsent:CHBGDPRConsentBehavioral]];
Possible consent values are CHBGDPRConsentBehavioral
and CHBGDPRConsentNonBehavioral.
Chartboost will store the consent status even after the app is closed. In order to reset this information use:
Chartboost.clearDataUseConsent(for: CHBPrivacyStandard.GDPR)
[Chartboost clearDataUseConsentForPrivacyStandard:CHBPrivacyStandardGDPR];
CCPA
To set CCPA consent:
/**
* CCPA support settings:
* optInSale(1YN-) means the user consents (Behavioral and Contextual Ads)
* optOutSale(1YY-) means the user does not consent to targeting (Contextual ads)
*/
Chartboost.addDataUseConsent(CHBDataUseConsent.CCPA(CHBDataUseConsent.CCPA.Consent.optInSale))
/**
* CCPA support settings:
* CHBCCPAConsentOptInSale(1YN-) means the user consents (Behavioral and Contextual Ads)
* OPT_OUT_SALE(1YY-) means the user does not consent to targeting (Contextual ads)
*/
[Chartboost addDataUseConsent:[CHBCCPADataUseConsent ccpaConsent:CHBCCPAConsentOptInSale]];
Possible consent values are CHBCCPAConsentOptInSale
and CHBCCPAConsentOptOutSale
.
Chartboost will store the consent status even after the app is closed. In order to reset this information use:
Chartboost.clearDataUseConsent(for: CHBPrivacyStandard.CCPA)
[Chartboost clearDataUseConsentForPrivacyStandard:CHBPrivacyStandardCCPA];
COPPA
To set COPPA consent:
/**
* 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)
*/
Chartboost.addDataUseConsent(CHBDataUseConsent.COPPA(isChildDirected: true))
/**
* 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)
*/
[Chartboost addDataUseConsent:[CHBCOPPADataUseConsent isChildDirected:true]];
Possible consent values are true
and false
.
Chartboost will store the consent status even after the app is closed. In order to reset this information use:
Chartboost.clearDataUseConsent(for: CHBPrivacyStandard.COPPA)
[Chartboost clearDataUseConsentForPrivacyStandard:CHBPrivacyStandardCOPPA];
LGPD
To set LGPD consent:
/**
* LGPD:
* true means that the user consents (Behavioral and Contextual Ads)
* false means that the user does not consent to targeting (Contextual Ads)
*/
Chartboost.addDataUseConsent(CHBDataUseConsent.LGPD(allowBehavioralTargeting: true))
/**
* LGPD:
* true means that the user consents (Behavioral and Contextual Ads)
* false means that the user does not consent to targeting (Contextual Ads)
*/
[Chartboost addDataUseConsent:[CHBLGPDDataUseConsent allowBehavioralTargeting:true]];
Possible consent values are true
and false
.
Chartboost will store the consent status even after the app is closed. In order to reset this information use:
Chartboost.clearDataUseConsent(for: CHBPrivacyStandard.LGPD)
[Chartboost clearDataUseConsentForPrivacyStandard:CHBPrivacyStandardLGPD];
Custom Consent
Chartboost allows publishers to provide custom consent information, besides the predefined GDPR and CCPA values.
For example:
Chartboost.addDataUseConsent(CHBDataUseConsent.Custom(privacyStandard: CHBPrivacyStandard.CCPA, consent: "1NN-"))
[Chartboost addDataUseConsent:[CHBCustomDataUseConsent customConsentWithPrivacyStandard:CHBPrivacyStandardCCPA consent:@"1NN-"]];
Caution
Currently, the only custom consent values allowed are valid IAB's U.S. Privacy String for the
CHBPrivacyStandardCCPA
standard.
Updated 4 months ago