Skip to content

Custom Targeting

The BoldwinTargeting class allows you to enrich ad requests with app and user targeting information. Its properties are aligned with OpenRTB v2.5.

Note: This configuration is global and applies to all ad units.

BoldwinTargeting

Property Data Type Description ORTB
app BoldwinTargetingApp Application-specific targeting information based on the OpenRTB 2.5 App object. app
user BoldwinTargetingUser User-specific targeting information based on the OpenRTB 2.5 User object. user

Example:

val targeting = BoldwinTargeting.Builder()
    .app(app)
    .user(user)
    .build()

BoldwinTargetingApp

Property Data Type Description ORTB
bundle String Package name (application bundle). Used to identify the app on app stores. bundle
version String App version. ver
name String App name. name
storeUrl String App store URL. storeurl
domain String App’s top-level domain (developer or brand site). domain
paid Int 1 = paid app, 0 = free app. paid
privacyPolicy Int 1 = app has privacy policy, 0 = no policy. privacypolicy
keywords List<String> List of keywords describing the app content. keywords
cat List<String> IAB content categories for the app. cat
sectionCat List<String> IAB section-level categories (subcategory groupings). sectioncat
pageCat List<String> IAB page-level categories. pagecat
publisher BoldwinPublisher Publisher information for the app (owner/distributor). publisher
content BoldwinContent Content metadata contained within the app (e.g., video, article, music). content
ext BoldwinTargetingExt Exchange-specific extensions or custom fields. ext

Example:

val app = BoldwinTargetingApp.Builder()
    .bundle("com.example.app")
    .version("1.0.0")
    .name("Example App")
    .storeUrl("https://play.google.com/store/apps/details?id=com.example.app")
    .domain("example.com")
    .paid(0)
    .privacyPolicy(1)
    .keywords(listOf("example", "demo", "news"))
    .cat(listOf("IAB1", "IAB2"))
    .sectionCat(listOf("SectionA", "SectionB"))
    .pageCat(listOf("PageX", "PageY"))
    .publisher(
        BoldwinPublisher.Builder()
            .id("pub_001")
            .name("Example Publisher")
            .domain("publisher.example")
            .categories(mutableListOf("News", "Entertainment"))
            .build()
    )
    .content(/* see BoldwinContent */)
    .ext(BoldwinTargetingExt().apply { put("custom_app_key", "custom_app_value") })
    .build()

BoldwinTargetingUser

Property Data Type Description ORTB
id String Exchange-specific unique user ID. id
buyerUid String Buyer-specific user ID (DSP/advertiser). buyeruid
yearOfBirth Int Year of birth for demographic targeting. yob
gender String “M” = Male, “F” = Female, “O” = Other/Unknown. gender
keywords List<String> List of keywords associated with the user. keywords
customData String Custom data stored by bidder/advertiser. customdata
geo BoldwinGeo User geographic information (GPS/IP/profile). geo
data List<BoldwinTargetingData> Data segments from third-party providers for audience targeting. data
extendedIds List<BoldwinExtendedId> Extended IDs (e.g., ecosystem IDs for identity resolution). eids
ext BoldwinTargetingExt Custom or exchange-specific user fields. ext

Example:

val user = BoldwinTargetingUser.Builder()
    .id("user123")
    .buyerUid("buyer456")
    .yearOfBirth(1990)
    .gender("M")
    .keywords(mutableListOf("sports", "tech"))
    .customData("customUserData123")
    .geo(/* see BoldwinGeo */)
    .data(mutableListOf(/* BoldwinTargetingData */))
    .extendedIds(mutableListOf(/* BoldwinExtendedId */))
    .ext(BoldwinTargetingExt().apply { put("user_attr", "premium") })
    .build()

BoldwinContent

Property Data Type Description ORTB
id String Unique ID for the content. id
title String Content title. title
series String Series the content belongs to. series
season String Season of the series. season
episode Int Episode number. episode
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 for music. isrc
producer BoldwinContentProducer Information about the content’s producer. producer
url String URL to the content or landing page. url
categories List<String> IAB content categories for the content. cat
productionQuality Int Production quality (OpenRTB values). prodq
context Int Content context type (OpenRTB values). context
contentRating String Content rating label. contentrating
userRating String User rating of the content. userrating
qagMediaRating Int IAB QAG media rating. qagmediarating
keywords String Comma-separated keywords about the content. keywords
liveStream Int 1 = live, 0 = not live. livestream
sourceRelationship Int 0 = Unrelated, 1 = Direct, 2 = Syndicated. sourcerel
len Int Content length in seconds. len
language String ISO 639-1 language code. language
embeddable Int 1 = embeddable, 0 = not embeddable. embeddable
data List<BoldwinTargetingData> Additional content data arrays. data
ext BoldwinTargetingExt Exchange-specific extensions. ext

Example:

val producer = BoldwinContentProducer.Builder()
    .id("producer_001")
    .name("Sample Producer")
    .cat(listOf("Category1", "Category2"))
    .domain("producer.example")
    .ext(BoldwinTargetingExt().apply { put("prod_key", "prod_value") })
    .build()

val content = BoldwinContent.Builder()
    .id("content_001")
    .title("Sample Title")
    .series("Sample Series")
    .season("Season 1")
    .episode(5)
    .artist("Sample Artist")
    .genre("Documentary")
    .album("Sample Album")
    .isrc("US-XXX-99-12345")
    .producer(producer)
    .url("https://example.com/content")
    .productionQuality(2)
    .context(1)
    .contentRating("PG-13")
    .userRating("4.5")
    .qagMediaRating(1)
    .keywords("documentary,science,space")
    .liveStream(0)
    .sourceRelationship(1)
    .len(1800)
    .language("en")
    .embeddable(1)
    .categories(listOf("IAB1", "IAB2"))
    .data(listOf(/* see BoldwinTargetingData */))
    .ext(BoldwinTargetingExt().apply { put("content_type", "video/mp4") })
    .build()

BoldwinGeo

Property Data Type Description ORTB
lat Double Latitude (-90 to +90). lat
lon Double Longitude (-180 to +180). lon
type Int Location source (1 = GPS, 2 = IP, 3 = User provided). type
accuracy Int Estimated accuracy in meters. accuracy
lastfix Int Seconds since the last location fix. lastfix
ipservice Int IP geolocation service (e.g., 1..n per exchange). ipservice
country String ISO 3166-1 alpha-3 country code. country
region String ISO 3166-2 region code. region
regionfips104 String FIPS 10-4 region code (if applicable). regionfips104
metro String Nielsen DMA/metro code. metro
city String City name. city
zip String ZIP/postal code. zip
utcoffset Int Local time offset from UTC in minutes. utcoffset
ext BoldwinTargetingExt Exchange-specific extensions. ext

Example:

val geo = BoldwinGeo.Builder()
    .lat(40.7128)
    .lon(-74.0060)
    .type(1)
    .accuracy(50)
    .lastfix(300)
    .ipservice(3)
    .country("USA")
    .region("NY")
    .regionfips104("US36")
    .metro("501")
    .city("New York")
    .zip("10001")
    .utcoffset(-300)
    .ext(BoldwinTargetingExt().apply { put("geo_note", "gps") })
    .build()

BoldwinExtendedId

Property Data Type Description ORTB
source String Source of the external user identity. source
uniqueIds List<BoldwinUniqueId> Array of user IDs from the given source. uids

Example:

val eid = BoldwinExtendedId.Builder()
    .source("adserver.org")
    .uniqueIds(
        listOf(
            BoldwinUniqueId.Builder().id("uid_123").atype(1).build(),
            BoldwinUniqueId.Builder().id("dev_456").atype(2).build()
        )
    )
    .build()

BoldwinUniqueId

Property Data Type Description ORTB
id String Cookie or platform-native identifier. id
atype Int Agent type for the ID (per OpenRTB guidance). atype

Example:

val uid = BoldwinUniqueId.Builder()
    .id("unique_id_123")
    .atype(1)
    .build()

BoldwinContentProducer

Property Data Type Description ORTB
id String Exchange-specific producer ID. id
name String Producer name. name
cat List<String> IAB content categories for the producer’s content. cat
domain String Producer’s top-level domain. domain
ext BoldwinTargetingExt Exchange-specific extensions. ext

Example:

val producer = BoldwinContentProducer.Builder()
    .id("producer_001")
    .name("Test Producer")
    .cat(listOf("Category1", "Category2"))
    .domain("producer.com")
    .ext(BoldwinTargetingExt().apply { put("producer_key", "value") })
    .build()

BoldwinPublisher

Property Data Type Description ORTB
id String Exchange-specific publisher ID. id
name String Publisher name. name
categories List<String> IAB content categories that describe the publisher. cat
domain String Publisher’s domain. domain
ext BoldwinTargetingExt Exchange-specific extensions. ext

Example:

val publisher = BoldwinPublisher.Builder()
    .id("pub_001")
    .name("Test Publisher")
    .domain("publisher.com")
    .categories(mutableListOf("News", "Entertainment"))
    .ext(BoldwinTargetingExt().apply { put("pub_tier", "gold") })
    .build()

BoldwinTargetingData

Property Data Type Description ORTB
id String ID of the data provider (exchange-specific). id
name String Data provider name. name
segment List<BoldwinTargetingSegment> Array of segment objects with actual values. segment
ext BoldwinTargetingExt Exchange-specific extensions. ext

Example:

val data = BoldwinTargetingData.Builder()
    .id("data_001")
    .name("Interest Data")
    .segment(
        listOf(
            BoldwinTargetingSegment.Builder()
                .id("seg_a")
                .name("Sports")
                .value("football")
                .ext(BoldwinTargetingExt().apply { put("confidence", "0.9") })
                .build()
        )
    )
    .ext(BoldwinTargetingExt().apply { put("provider_tier", "A") })
    .build()

BoldwinTargetingSegment

Property Data Type Description ORTB
id String Data segment ID (provider-specific). id
name String Data segment name. name
value String String value of the segment. value
ext BoldwinTargetingExt Exchange-specific or custom extensions. ext

Example:

val segment = BoldwinTargetingSegment.Builder()
    .id("segment_001")
    .name("Affinity")
    .value("gamers")
    .ext(BoldwinTargetingExt().apply { put("ext_key", "seg_meta") })
    .build()