Skip to main content
Version: v1.0.0

Privacy

Prebid adds consent signals to every bid request. Most apps don't set them by hand: a consent management platform (CMP) writes the IAB keys to the device and the native SDKs read them. PrebidTargeting lets you set or override them when you don't use a CMP.

What the SDK reads by itself​

FrameworkKeysStorage
TCF v2 (GDPR)IABTCF_gdprApplies, IABTCF_TCString, IABTCF_PurposeConsentsDefault SharedPreferences (Android) / UserDefaults (iOS)
US Privacy (CCPA)IABUSPrivacy_StringSame
GPPIABGPP_HDR_GppString, IABGPP_GppSIDSame

A CMP SDK that follows the IAB specs fills these in; Prebid sends them as regs.gdpr, user.ext.consent, regs.us_privacy, regs.gpp and regs.gpp_sid.

Setting signals explicitly​

// GDPR / TCF v2
await PrebidTargeting.setSubjectToGDPR(true);
await PrebidTargeting.setGDPRConsentString('CPXxRfAPXxRfAAfKABENB-CgAAAAAAAAAAYgAAAAAAAA');
await PrebidTargeting.setPurposeConsents('101111');

// CCPA
await PrebidTargeting.setUSPrivacyString('1YNN');

// COPPA
await PrebidTargeting.setSubjectToCOPPA(true);

Pass null to any setter to clear the value. Explicit values take precedence over the CMP's.

MethodDescription
setSubjectToGDPR(bool?) / getSubjectToGDPR()Whether GDPR applies (regs.gdpr).
setGDPRConsentString(String?) / getGDPRConsentString()The TCF consent string.
setPurposeConsents(String?) / getPurposeConsents()TCF purpose consents as a binary string ("101…").
getPurposeConsent(int index)Consent for one purpose, 0-based (purpose 1 is index 0).
getDeviceAccessConsent()TCF purpose 1: storing and reading information on the device.
isAllowedAccessDeviceData()Whether Prebid may read device data: purpose 1 consented, or unanswered while GDPR doesn't apply.
setUSPrivacyString(String?) / getUSPrivacyString()The IAB US Privacy string (regs.us_privacy).
setSubjectToCOPPA(bool?) / getSubjectToCOPPA()COPPA (regs.coppa).

Neither Prebid SDK has a US Privacy setter: both read IABUSPrivacy_String from the IAB storage. setUSPrivacyString writes it there (the default SharedPreferences on Android, UserDefaults on iOS), so unlike the other targeting values it persists across launches until you pass null, it is the same value a consent management platform writes (the last writer wins), and it reaches every other SDK that follows the IAB spec.

Prebid limits what it sends when consent is missing: without device-access consent (TCF purpose 1) under GDPR, the advertising ID and other device identifiers are left out. setShareGeoLocation(true) sends the location only when the app holds the location permission.

App Tracking Transparency iOS only​

Ask for ATT permission before initializing the SDK if you rely on the IDFA. With initializeSdk(nonTrackingUrl: …), Prebid sends requests to a separate Prebid Server endpoint while tracking isn't authorized.

First-party data access​

To limit which bidders receive your first-party data, see the access control list.