Builder

class Builder
kotlin.Any
   ↳ android.adservices.adselection.AdSelectionConfig.Builder

Builder for AdSelectionConfig object.

Summary

Public constructors

Public methods
AdSelectionConfig

Builds an AdSelectionConfig instance.

AdSelectionConfig.Builder

Sets the signals provided to buyers during ad selection bid generation.

AdSelectionConfig.Builder

Sets the contextual Ads corresponding to each buyer during ad selection.

AdSelectionConfig.Builder

Sets the list of allowed buyers.

AdSelectionConfig.Builder
setDecisionLogicUri(decisionLogicUri: Uri)

Sets the URI used to fetch decision logic for use in the ad selection process.

AdSelectionConfig.Builder

Sets the signals provided by each buyer during ad selection.

AdSelectionConfig.Builder

Sets the seller identifier.

AdSelectionConfig.Builder

Set the signals used to modify ad selection results.

AdSelectionConfig.Builder
setTrustedScoringSignalsUri(trustedScoringSignalsUri: Uri)

Sets the URI endpoint of sell-side trusted signal from which creative specific realtime information can be fetched from.

Public constructors

Builder

Builder()

Public methods

build

fun build(): AdSelectionConfig

Builds an AdSelectionConfig instance.

Return
AdSelectionConfig This value cannot be null.
Exceptions
java.lang.NullPointerException if any required params are null

setAdSelectionSignals

fun setAdSelectionSignals(adSelectionSignals: AdSelectionSignals): AdSelectionConfig.Builder

Sets the signals provided to buyers during ad selection bid generation.

If not set, defaults to the empty JSON.

See getAdSelectionSignals() for more details.

Parameters
adSelectionSignals AdSelectionSignals: This value cannot be null.
Return
AdSelectionConfig.Builder This value cannot be null.

setBuyerSignedContextualAds

fun setBuyerSignedContextualAds(buyerSignedContextualAds: MutableMap<AdTechIdentifier!, SignedContextualAds!>): AdSelectionConfig.Builder

Sets the contextual Ads corresponding to each buyer during ad selection.

If not set, defaults to an empty map.

See getBuyerSignedContextualAds() ()} for more details.

Parameters
buyerSignedContextualAds MutableMap<AdTechIdentifier!, SignedContextualAds!>: This value cannot be null.
Return
AdSelectionConfig.Builder This value cannot be null.

setCustomAudienceBuyers

fun setCustomAudienceBuyers(customAudienceBuyers: MutableList<AdTechIdentifier!>): AdSelectionConfig.Builder

Sets the list of allowed buyers.

See getCustomAudienceBuyers() for more details.

Parameters
customAudienceBuyers MutableList<AdTechIdentifier!>: This value cannot be null.
Return
AdSelectionConfig.Builder This value cannot be null.

setDecisionLogicUri

fun setDecisionLogicUri(decisionLogicUri: Uri): AdSelectionConfig.Builder

Sets the URI used to fetch decision logic for use in the ad selection process. Decision URI could be either of the two schemas:

  • HTTPS: HTTPS URIs have to be absolute URIs where the host matches the seller
  • Ad Selection Prebuilt: Ad Selection Service URIs follow ad-selection-prebuilt://ad-selection/<name>?<script-generation-parameters> format. FLEDGE generates the appropriate JS script without the need for a network call.

    Available prebuilt scripts:

    • highest-bid-wins for scoreAds and reportResult: This JS picks the ad with the highest bid for scoring. For reporting, the given URI is parameterized with render_uri and bid. Below parameter(s) are required to use this prebuilt:
      • reportingUrl: Base reporting uri that will be parameterized later with render_uri and bid

      Ex. If your base reporting URL is "https://www.ssp.com" then, ad-selection-prebuilt://ad-selection/highest-bid-wins/?reportingUrl=https://www.ssp.com

See getDecisionLogicUri() for more details.

Parameters
decisionLogicUri Uri: This value cannot be null.
Return
AdSelectionConfig.Builder This value cannot be null.

setPerBuyerSignals

fun setPerBuyerSignals(perBuyerSignals: MutableMap<AdTechIdentifier!, AdSelectionSignals!>): AdSelectionConfig.Builder

Sets the signals provided by each buyer during ad selection.

If not set, defaults to an empty map.

See getPerBuyerSignals() for more details.

Parameters
perBuyerSignals MutableMap<AdTechIdentifier!, AdSelectionSignals!>: This value cannot be null.
Return
AdSelectionConfig.Builder This value cannot be null.

setSeller

fun setSeller(seller: AdTechIdentifier): AdSelectionConfig.Builder

Sets the seller identifier.

See getSeller() for more details.

Parameters
seller AdTechIdentifier: This value cannot be null.
Return
AdSelectionConfig.Builder This value cannot be null.

setSellerSignals

fun setSellerSignals(sellerSignals: AdSelectionSignals): AdSelectionConfig.Builder

Set the signals used to modify ad selection results.

If not set, defaults to the empty JSON.

See getSellerSignals() for more details.

Parameters
sellerSignals AdSelectionSignals: This value cannot be null.
Return
AdSelectionConfig.Builder This value cannot be null.

setTrustedScoringSignalsUri

fun setTrustedScoringSignalsUri(trustedScoringSignalsUri: Uri): AdSelectionConfig.Builder

Sets the URI endpoint of sell-side trusted signal from which creative specific realtime information can be fetched from.

If Uri#EMPTY is passed then network call will be skipped and android.adservices.common.AdSelectionSignals#EMPTY will be passed to ad selection.

See getTrustedScoringSignalsUri() for more details.

Parameters
trustedScoringSignalsUri Uri: This value cannot be null.
Return
AdSelectionConfig.Builder This value cannot be null.