IAB Global Privacy Platform
Using Mobile App Consent, you can enable the IAB Global Privacy Platform (GPP) for enhanced compliance with US data privacy laws.
IAB GPP helps address the challenges posed by the growing number of different privacy regulations worldwide. Implementing OneTrust with the IAB Global Privacy Platform Consent empowers publishers to streamline ad tech vendors and advertising content.
You can leverage GPP when configuring for the following frameworks:
California Privacy Rights Act (CPRA)
California Consumer Privacy Act (CCPA)
Virginia Consumer Data Protection Act (CDPA)
Colorado Privacy Act (CPA)
Connecticut Data Privacy Act (CTDPA)
Utah
US National
Note
First, GPP needs to be enabled from geolocation rules within the OneTrust Admin console. For more information on how to configure please visit Configuring Global Privacy Settings
Accessing GPP data
Once a user gives consent, OneTrust will write IAB GPP data and save it to UserDefaults. Your application can access the data by fetching it using following keys.
GPP Keys | Data type | Description |
---|---|---|
IABGPP_HDR_Version | Integer | GPP version |
IABGPP_HDR_Sections | String | List of Section IDs |
IABGPP_HDR_GppString | String | Full consent string in its encoded form |
IABGPP_GppSID | String | Section ID(s) considered to be in force. Multiple IDs are separated by underscore, e.g. “2_3” |
Sample Code Snippet
// Swift
var GppValue : Any?
guard let savedValue = UserDefaults.standard.value(forKey: "IABGPP_HDR_GppString") else {
GppValue = ""
return
}
if savedValue is Int {
GppValue = String(savedValue as! Int)
} else if savedValue is String {
GppValue = String(savedValue as! String)
}
// ObjC
id GppValue;
id savedValue = [NSUserDefaults.standardUserDefaults valueForKey:@"IABGPP_HDR_GppString"];
if (savedValue) {
GppValue = (NSString *)savedValue;
} else {
GppValue = @"";
}
Section IDs
GPP Key | Data type | Description |
---|---|---|
IABGPP_[SectionID]_String | String | String representation of each section. E.g. IAB TCF EU v2 String will be found at IABGPP_2_String |
Each section represents a unique privacy signal, usually a unique jurisdiction. Below are the supported sections, for more information please visit GPP Signal IDs
Section ID | Key | Description |
---|---|---|
2 | IABGPP_2_String | EU TCF v2 section |
6 | IABGPP_6_String | USPrivacy String |
7 | IABGPP_7_String | US - national section |
8 | IABGPP_8_String | US - California section |
9 | IABGPP_9_String | US - Virginia section |
10 | IABGPP_10_String | US - Colorado section |
11 | IABGPP_11_String | US - Utah section |
12 | IABGPP_12_String | US - Connecticut section |
Sample Code Snippet
// Swift-US National
var GppValue : Any?
guard let savedValue = UserDefaults.standard.value(forKey: "IABGPP_7_String") else {
GppValue = ""
return
}
if savedValue is Int {
GppValue = String(savedValue as! Int)
} else if savedValue is String {
GppValue = String(savedValue as! String)
}
// ObjC
id GppValue;
id savedValue = [NSUserDefaults.standardUserDefaults valueForKey:@"IABGPP_7_String"];
if (savedValue) {
GppValue = (NSString *)savedValue;
} else {
GppValue = @"";
}
GPP keys for USPrivacy
GPP Keys | Data type | Description |
---|---|---|
IABGPP_USP1_Version | Integer | IAB US Privacy String Version number (see IAB US Privacy v1 specification) |
IABGPP_USP1_Notice | String | IAB US Privacy notice has been provided |
IABGPP_USP1_OptOut | String | IAB US Privacy opt out of sale |
IABGPP_USP1_LSPACovered | String | IAB US Privacy publisher is signatory to the LSPA |
Sample Code Snippet
// Swift-USPrivacy
var PrivacyNotice : Any?
guard let savedValue = UserDefaults.standard.value(forKey: "IABGPP_USP1_Notice") else {
PrivacyNotice = ""
return
}
if savedValue is Int {
PrivacyNotice = String(savedValue as! Int)
} else if savedValue is String {
PrivacyNotice = String(savedValue as! String)
}
// ObjC
id PrivacyNotice;
id savedValue = [NSUserDefaults.standardUserDefaults valueForKey:@"IABGPP_USP1_Notice"];
if (savedValue) {
PrivacyNotice = (NSString *)savedValue;
} else {
PrivacyNotice = @"";
}
Updated 3 months ago