Global Targeting Parameters

Prebid Mobile supports the following global targeting parameters. These targeting parameters are set only once and apply to all Prebid Mobile ad units. They do not change for a given user session.

Global User Targeting


public var gender:Gender

gender is an enum with the following values:

public enum Gender: String {
    case unknown
    case male
    case female

You can retrieve and set the gender for targeting:

let gender = Targeting.shared.gender

//do something with gender
Targeting.shared.gender = .unknown;

Year of Birth

public var yearofbirth:Int?

You can retrieve and set the year of birth for targeting:

if let yob = Targeting.shared.yearofbirth {
    //do something with yob

guard let yob = Targeting.shared.yearofbirth else {
    print("There was an error retrieving year of birth)

//do something with yob
Targeting.shared.yearofbirth = 1990;

User Keywords

User keywords are a list of keywords, intrests or intent as defined by user.keywords in OpenRTB 2.5. Any keywords passed in the UserKeywords object may be passsed to DSPs.

Add User Keyword

func addUserKeyword(_ newElement: String)

Add User Keywords

func addUserKeywords(_ newElements: Set<String>)

Remove User Keywords

func removeUserKeyword(_ element: String)

Clear User Keywords

func clearUserKeywords()


[Targeting.shared addUserKeyword:@"globalUserKeywordValue1"];
[Targeting.shared addUserKeyword:@"globalUserKeywordValue2"];
[Targeting.shared addUserKeyword:@"globalUserKeywordValue3"];

Global Application Targeting


Retrieve and set the domain of your app with the following commands:

Targeting.shared.domain = domain

Store URL

Retrieve and set the domain of your store URL with the following command:

Targeting.shared.storeURL = "itunes store URL string"


Retrieve and set the domain of your iTunes ID with the below command. This field will be transmitted to buyers as the bundle ID as recommended in OpenRTB 2.5. Failure to supply this value can have a negative monetary impact.

Targeting.shared.itunesID = itunesID

Open Measurment SDK (OMSDK)

OMSDK is designed to facilitate 3rd party viewability and verification measurement for ads served in mobile app enviroments. Prebid SDK will provide the signaling component to Bid Adapters, by way of Prebid Server, indicating the impression is elligible for OMSDK support. Prebid SDK does not currently integrate with OMSDK itself, instead it will rely on a publisher ad server to render viewability and verification measurement code.

There three components to signaling support for OMSDK:

  • Partner Name
  • Partner Version
  • API code

Partner Name

This will be the IAB OMSDK compliant partner name responsible for integrating with the OMSDK spec. See below for configuration and examples


Open Measurement partner name.




Targeting.shared.omidPartnerName = "Google"

Objective C

Targeting.shared.omidPartnerName = @"Google";

Partner Version

The OMSDK version number the partner integrated with. See below for configuration and examples.


Partner’s OMSDK version number implementation




Targeting.shared.omidPartnerVersion = "1.0"

Objective C

Targeting.shared.omidPartnerVersion = @"1.0";

API Code

Per OpenRTB 2.5, support for OMSDK is signaled using the imp.[media type].api field represented in Prebid SDK withing each ad format type under the parameters object. Refer to the documentation of the respective ad unit class.


let bannerUnit = BannerAdUnit(configId: "6ace8c7d-88c0-4623-8117-75bc3f0a2e45", size: CGSize(width: 300, height: 250))
let parameters = BannerAdUnit.Parameters()
parameters.api = [Signals.Api(7)]

Inventory (Context) Keywords

Context Keywords are a list of keywords about the app as referenced in OpenRTB 2.5 as app.keywords. Any keyword passed in the context keyword field may be passed to the buyer for targeting.

Add Context Keyword

func addContextKeyword(_ newElement: String)

Add Context Keywords

func addContextKeywords(_ newElements: Set<String>)

Remove Context Keywords

func removeContextKeyword(_ element: String)

Clear Context Keywords

func clearContextKeywords()




Objective C

[Targeting.shared addContextKeyword:@"globalContextKeywordValue1"];
[Targeting.shared addContextKeyword:@"globalContextKeywordValue2"];
[Targeting.shared addContextKeyword:@"globalContextKeywordValue3"];

First Party Data

First Party Data (FPD) is free form data supplied by the publisher to provide additional targeting of the user or inventory context, used primarily for striking PMP (Private MarketPlace) deals with Advertisers. Data supplied in the data parameters are typically not sent to DSPs whereas information sent in non-data objects (i.e. setYearOfBirth, setGender, etc.) will be. Access to FPD can be limited to a supplied set of Prebid bidders via an access control list.

Data is broken up into two different data types:

  • User
    • Global in scope only
  • Inventory (context)
    • Global scope
    • Ad Unit grain

The below first party user and inventory context will apply to all ad units. For ad unit level first party data, refer to First Partay Data section in the Ad Unit page.

First Party User Data

Add User Data

func addUserData(key: String, value: String)

Update User Data

func updateUserData(key: String, value: Set<String>)

Remove User Data

func removeUserData(forKey: String)

Clear User Data

func clearUserData()



Targeting.shared.addUserData(key: "globalUserDataKey1", value: "globalUserDataValue1")

Object C

[Targeting.shared addUserDataWithKey:@"globalUserDataKey1" value:@"globalUserDataValue1"];

First Party Inventory (Context) Data

Add Context Data

func addContextData(key: String, value: String)

Update Context Data

func updateContextData(key: String, value: Set<String>)

Remove Context Data

func removeContextData(forKey: String)

Clear Context Data

func clearContextData()



Targeting.shared.addContextData(key: "globalContextDataKey1", value: "globalContextDataValue1")

Objective C

[Targeting.shared addContextDataWithKey:@"globalContextDataKey1" value:@"globalContextDataValue1"];

Ad Unit Context Data

For ad unit context data, please refer to the ad unit section.

Access Control

The First Party Data Access Control List provides a method to restrict access to first party data to a supplied list of bidders.


func addBidderToAccessControlList(_ bidderName: String)


func removeBidderFromAccessControlList(_ bidderName: String)


func clearAccessControlList()




Objective C

[Targeting.shared addBidderToAccessControlList: Prebid.bidderNameRubiconProject];


Prebid Mobile supports the IAB GDPR recommendations. For a general overview of Prebid Mobile support for GDPR, see Prebid Mobile Guide to European Ad Inventory and Providing Notice, Transparency and Choice

Subject To GPDR

public var subjectToGDPR:Bool?

You can retrieve and set the subjectToGDPR for targeting:

if let subjectToGDPR = Targeting.shared.subjectToGDPR {
    //do something with subjectToGDPR

guard let subjectToGDPR = Targeting.shared.subjectToGDPR else {
    print("There was an error retrieving subjectToGDPR)

//do something with subjectToGDPR

Targeting.shared.subjectToGDPR = false
public var gdprConsentString?

You can retrieve and set the subjectToGDPR for targeting:

if let gdprConsentString = Targeting.shared.gdprConsentString {
    //do something with gdprConsentString

guard let gdprConsentString = Targeting.shared.gdprConsentString else {
    print("There was an error retrieving gdprConsentString)

//do something with gdprConsentString

Targeting.shared.gdprConsentString = "A String"
public var purposeConsents: String?

You can retrieve and set the purposeConsents for targeting:


Targeting.shared.purposeConsents = "100000000000000000000000"

defer {

  Targeting.shared.purposeConsents = nil



let deviceAccessConsent = Targeting.shared.getDeviceAccessConsent()

Subject to COPPA

Prebid supports passing of the Child Online Privacy Prection (COPPA) signal to Prebid Server (PBS) for all COPPA traffic. When PBS receives the COPPA flag we strip out all personal data from the requeset. For a general overview of COPPA, see the FTC’s guidlines.

var subjectToCOPPA: Bool



Targeting.shared.subjectToCOPPA = true

Objective C

Targeting.shared.subjectToCOPPA = true;

Further Reading