Skip to content

Latest commit

 

History

History
161 lines (110 loc) · 3.11 KB

pbm-targeting-ios.md

File metadata and controls

161 lines (110 loc) · 3.11 KB
layout title description top_nav_section nav_section sidebarType
page_v2
Global Targeting Parameters - iOS
Prebid Mobile API global targeting parameters for iOS
prebid-mobile
prebid-mobile
2

Global Targeting Parameters

{:.no_toc}

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.

  • TOC {:toc}

Global User Targeting

Gender

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)
    return 
}

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

Global Application Targeting

Domain

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

Targeting.shared.domain
Targeting.shared.domain = domain

Store URL

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

Targeting.shared.itunesID
Targeting.shared.itunesID = itunesID

GPDR

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)
    return 
}

//do something with subjectToGDPR

Targeting.shared.subjectToGDPR = false

GDPR Consent String

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)
    return 
}

//do something with gdprConsentString

Targeting.shared.gdprConsentString = "A String"

Further Reading