Custom Targeting
The BoldwinTargeting class allows to enrich the ad request with the app and user targeting information. Its properties are fully-compatible with OpenRTB v2.5.
Note: This configuration is global and applies to all ad units.
BoldwinTargeting
| Property | Data Type | Description | ORTB |
|---|---|---|---|
app |
BoldwinTargetingApp |
Represents application-specific targeting information based on OpenRTB 2.5 App object. | app |
user |
BoldwinTargetingUser |
Represents user-specific targeting information based on OpenRTB 2.5 User object. | user |
Example:
BoldwinTargetingApp
| Property | Data Type | Description | ORTB |
|---|---|---|---|
id |
String |
Unique app ID assigned by the exchange. Often corresponds to the app’s identifier in the ad platform. | id |
name |
String |
App name. | name |
bundle |
String |
Bundle/package name. Useful for identifying apps on app stores (iOS or Android). | bundle |
domain |
String |
Domain of the app. Top-level domain associated with the app developer or brand. | domain |
storeUrl |
String |
App store URL. Can help validate app presence or quality. | storeurl |
categories |
[String] |
IAB content categories for the app. Helps with contextual targeting. | cat |
sectionCategories |
[String] |
IAB section-level categories (subcategory groupings). Used for additional contextual detail. | sectioncat |
pageCategories |
[String] |
IAB page-level categories. Even more granular content categorization. | pagecat |
version |
String |
App version. | ver |
privacyPolicy |
Bool |
Indicates if the app has a privacy policy: true = has privacy policy, false = no policy. | privacypolicy |
paid |
Bool |
true = app is a paid app (not free), false = free app. | paid |
keywords |
String |
Comma-separated list of keywords describing the app content. | keywords |
publisher |
BoldwinPublisher |
Publisher information for the app (i.e., the owner/distributor). | publisher |
content |
BoldwinContent |
Content details of what's inside the app (e.g., video, article, music). | content |
ext |
[String: Any] |
Placeholder for exchange-specific extensions or custom fields. | ext |
Example:
let app = BoldwinTargetingApp()
.setID("app-id-123")
.setName("Sample Targeting App")
.setBundle("com.sample.app")
.setDomain("sampleapp.com")
.setStoreUrl("https://apps.apple.com/app/id123456789")
.setCategories(["IAB1", "IAB10"])
.setSectionCategories(["IAB2", "IAB11"])
.setPageCategories(["IAB3", "IAB12"])
.setVersion("1.0.0")
.setPrivacyPolicy(false)
.setPaid(false)
.setPublisher(publisher)
.setContent(content)
.setKeywords("sample,app,testing")
.setExt(["key1": "value1", "key2": "value2"])
BoldwinTargetingUser
| Property | Data Type | Description | ORTB |
|---|---|---|---|
id |
String |
Exchange-specific unique user ID. Identifies the user from the perspective of the supply platform. | id |
buyerUserId |
String |
Buyer-specific user ID, commonly from DSP or advertiser perspective. This is the user ID from the bidder’s (buy-side) system. | buyeruid |
yearOfBirth |
Int |
Year of birth. Used for demographic targeting. | yob |
gender |
String |
Gender of the user: “M” = Male, “F” = Female, “O” = Other/Unknown. | gender |
keywords |
String |
Comma-separated list of keywords associated with the user. Useful for contextual or behavioral targeting. | keywords |
customData |
String |
Custom data stored by the bidder or advertiser. Can be encoded metadata or audience identifiers. | customdata |
geo |
BoldwinGeo |
Geographic information about the user. Typically derived from GPS, IP address, or user profile. | geo |
data |
[BoldwinData] |
Array of user data segments from third-party providers. Enables fine-grained audience targeting. | data |
extendedIds |
[BoldwinExtendedId] |
Array of extended user IDs (e.g., Unified ID 2.0, ID5, LiveRamp). Used for user identity resolution across platforms. | eids |
ext |
[String: Any] |
Placeholder for custom or exchange-specific user fields. | ext |
Example:
let user = BoldwinTargetingUser()
.setID("sample_user_id")
.setBuyerUserID("sample_buyer_id")
.setYearOfBirth(1990)
.setGender("F")
.setKeywords("sample,keywords,data")
.setCustomData("sample_custom_data")
.setGeo(geo)
.setData([userData])
.setExtendedIds([extendedId])
.setExt(["sample_user_key": "sample_user_value"])
BoldwinContent
| Property | Data Type | Description | ORTB |
|---|---|---|---|
id |
String |
ID uniquely identifying the content. | id |
episode |
Int |
Episode number (typically for video content). | episode |
title |
String |
Content title. | title |
series |
String |
Series the content is part of. | series |
season |
String |
Season of the series. | season |
artist |
String |
Artist credited with the content. | artist |
genre |
String |
Genre of the content. | genre |
album |
String |
Album the content belongs to. | album |
isrc |
String |
International Standard Recording Code (ISRC) for music. | isrc |
producer |
BoldwinProducer |
Details about the producer of the content. | producer |
url |
String |
URL of the content (direct or landing page). | url |
categories |
[String] |
Array of IAB content categories for the content. | cat |
productionQuality |
Int |
Production quality, as defined in OpenRTB (1 = Unknown, 2 = Professional, 3 = Prosumer, 4 = User Generated). | prodq |
context |
Int |
Type of content context (1 = Video, 2 = Game, 3 = Music, 4 = Application, 5 = Text, 6 = Other). | context |
contentRating |
String |
Content rating. | contentrating |
userRating |
String |
User rating of the content. | userrating |
qagMediaRating |
Int |
IAB’s QAG media rating (1 = All Audiences, 2 = Over 12, 3 = Mature). | qagmediarating |
keywords |
String |
Comma-separated list of keywords about the content. | keywords |
liveStream |
Bool |
Indicates if the content is a live stream. | livestream |
sourceRelationship |
Int |
Relationship of the content to the source (0 = Unrelated, 1 = Direct, 2 = Syndicated). | sourcerel |
length |
Int |
Length of content in seconds. | len |
language |
String |
ISO 639-1 content language code. | language |
embeddable |
Bool |
Whether content is embeddable (true = embeddable). | embeddable |
data |
[BoldwinData] |
Additional content data. | data |
ext |
[String: Any] |
Placeholder for exchange-specific extensions. | ext |
Example:
let content = BoldwinContent()
.setID("content-456")
.setEpisode(2)
.setCategories(["IAB3", "IAB4"])
.setTitle("Sample Episode Title")
.setSeries("Sample Series")
.setSeason("Season 1")
.setArtist("Sample Artist")
.setGenre("Fiction")
.setAlbum("Greatest Hits")
.setISRC("ISRC12345678")
.setProducer(producer)
.setURL("https://www.example.com/video/sample-episode")
.setID("sample_content_id")
.setTitle("The Great Sample Adventure")
.setSeries("Sample Series")
.setSeason("Season 2")
.setEpisode(5)
.setArtist("Jane Sample")
.setGenre("Adventure")
.setAlbum("Sample Soundtrack")
.setISRC("US-S1Z-99-12345")
.setCategories(["IAB1-1", "IAB1-2"])
.setProductionQuality(2)
.setContext(1)
.setContentRating("TV-PG")
.setUserRating("4.6")
.setQagMediaRating(1)
.setKeywords("sample,video,adventure,episode")
.setLiveStream(false)
.setSourceRelationship(1)
.setLength(1440)
.setLanguage("en")
.setEmbeddable(true)
.setData([contentData])
.setExt([
"contentType": "video/mp4",
"subtitleLanguage": "en",
"customTag": "sample_tag"
])
BoldwinGeo
| Property | Data Type | Description | ORTB |
|---|---|---|---|
latitude |
Double |
Latitude from -90.0 to +90.0, where negative is south. | lat |
longitude |
Double |
Longitude from -180.0 to +180.0, where negative is west. | lon |
type |
Int |
Source of location data (1 = GPS/Location Services, 2 = IP Address, 3 = User provided). | type |
accuracy |
Int |
Estimated location accuracy in meters. Relevant when using GPS or similar sources. | accuracy |
lastFix |
Int |
Number of seconds since this geolocation was last fixed. | lastfix |
ipService |
Int |
Service used to determine geolocation from IP address (1 = IP2Location, 2 = Neustar, 3 = MaxMind, 4 = NetAcuity, etc.). | ipservice |
country |
String |
Country code (ISO 3166-1 alpha-3). | country |
region |
String |
Region code (ISO 3166-2). | region |
regionFips104 |
String |
Region code using FIPS 10-4 standard (may be used by some systems). | regionfips104 |
metro |
String |
Metro code (Designated Market Area - DMA) as defined by Nielsen. | metro |
city |
String |
City name. | city |
zip |
String |
Zip or postal code. | zip |
utcOffset |
Int |
Local time offset from UTC in minutes. | utcoffset |
ext |
[String: Any] |
Placeholder for exchange-specific extensions. | ext |
Example:
let geo = BoldwinGeo()
.setLatitude(40.7128)
.setLongitude(-74.0060)
.setType(1)
.setAccuracy(50)
.setLastFix(1725580800)
.setIpService(3)
.setCountry("US")
.setRegion("NY")
.setRegionFips104("US36")
.setMetro("501")
.setCity("New York")
.setZip("10001")
.setUtcOffset(-300)
.setExt(["sample_geo_key": "sample_geo_value"])
BoldwinExtendedId
| Property | Data Type | Description | ORTB |
|---|---|---|---|
source |
String |
The source of the external user ID. | source |
uids |
[BoldwinUid] |
Array of extended ID UID objects from the given source. | uids |
ext |
[String: Any] |
Additional attributes related to the external user ID, represented as an optional dictionary. | ext |
Example:
let extendedId = BoldwinExtendedId()
.setSource("sample_source")
.setUids([uid])
.setExt(["sample_eid_key": "sample_eid_value"])
BoldwinUid
| Property | Data Type | Description | ORTB |
|---|---|---|---|
id |
String |
Cookie or platform-native identifier. | id |
atype |
Int |
Type of user agent the match is from. Recommended for proper ID resolution across DSPs. | atype |
ext |
[String: Any] |
Additional attributes related to the external user ID. | ext |
Example:
let uid = BoldwinUid()
.setID("sample_uid")
.setAtype(3)
.setExt(["sample_uid_key": "sample_uid_value"])
BoldwinProducer
| Property | Data Type | Description | ORTB |
|---|---|---|---|
id |
String |
Exchange-specific ID for the content producer. A unique identifier assigned by the ad exchange or supply source. | id |
name |
String |
Name of the content producer. A human-readable name to identify the producer. | name |
categories |
[String] |
Array of IAB content categories for the producer’s content. Helps categorize the type of content typically produced. | cat |
domain |
String |
Top-level domain of the producer. Identifies the web domain or site associated with the producer. | domain |
ext |
[String: Any] |
Placeholder for exchange-specific extensions to the producer object. Used to pass any non-standard or custom fields. | ext |
Example:
let producer = BoldwinProducer()
.setID("producer-789")
.setName("Top Producer")
.setCategories(["IAB30", "IAB31"])
.setDomain("producer.com")
.setExt(["prodKey": "prodValue"])
BoldwinPublisher
| Property | Data Type | Description | ORTB |
|---|---|---|---|
id |
String |
Exchange-specific publisher ID. A unique identifier for the publisher as defined by the ad exchange. | id |
name |
String |
Name of the publisher. Human-readable name of the publisher. | name |
categories |
[String] |
Array of IAB content categories that describe the publisher. See IAB Content Categories for standardized values. | cat |
domain |
String |
Domain of the publisher. Helps identify the top-level site or app under which the ad will appear. | domain |
ext |
[String: Any] |
Placeholder for exchange-specific extensions to the publisher object. Allows for custom fields beyond the standard OpenRTB spec. | ext |
Example:
let publisher = BoldwinPublisher()
.setID("publisher-123")
.setName("Sample Publisher")
.setCategories(["IAB20", "IAB21"])
.setDomain("publisher.com")
.setExt(["pubKey": "pubValue"])
BoldwinData
| Property | Data Type | Description | ORTB |
|---|---|---|---|
id |
String |
ID of the data provider (exchange-specific). Unique identifier to reference the data source. | id |
name |
String |
Human-readable name of the data provider. | name |
segment |
[BoldwinSegment] |
Array of Segment (Section 3.2.22) objects that contain the actual data values. | segment |
ext |
[String: Any] |
Placeholder for exchange-specific extensions to the data object. | ext |
Example:
let contentData = BoldwinData()
.setID("sample_content_data_id")
.setName("Sample Content Data")
.setSegment([contentSegment])
.setExt(["sample_content_data_key": "sample_content_data_value"])
BoldwinSegment
| Property | Data Type | Description | ORTB |
|---|---|---|---|
id |
String |
ID of the data segment specific to the data provider. | id |
name |
String |
Name of the data segment specific to the data provider. | name |
value |
String |
String representation of the data segment value. | value |
ext |
[String: Any] |
Placeholder for exchange-specific or custom extensions. | ext |
Example: