AdSelectionConfig.Builder

public static final class AdSelectionConfig.Builder
extends Object

java.lang.Object
   ↳ android.adservices.adselection.AdSelectionConfig.Builder


AdSelectionConfig 物件的建構工具。

摘要

公用建構函式

Builder()

公用方法

AdSelectionConfig build()

建構 AdSelectionConfig 執行個體。

AdSelectionConfig.Builder setAdSelectionSignals(AdSelectionSignals adSelectionSignals)

設定在產生廣告選擇出價時提供給買方的信號。

AdSelectionConfig.Builder setBuyerContextualAds(Map<AdTechIdentifierContextualAds> buyerContextualAds)

在廣告選擇期間,設定與每個買方對應的內容相關廣告。

AdSelectionConfig.Builder setCustomAudienceBuyers(List<AdTechIdentifier> customAudienceBuyers)

設定允許的買家清單。

AdSelectionConfig.Builder setDecisionLogicUri(Uri decisionLogicUri)

設定用於擷取決策邏輯的 URI,以便用於廣告選擇程序。

AdSelectionConfig.Builder setPerBuyerSignals(Map<AdTechIdentifierAdSelectionSignals> perBuyerSignals)

設定每個買方在廣告選擇期間提供的信號。

AdSelectionConfig.Builder setSeller(AdTechIdentifier seller)

設定賣方 ID。

AdSelectionConfig.Builder setSellerSignals(AdSelectionSignals sellerSignals)

設定用於修改廣告選擇結果的信號。

AdSelectionConfig.Builder setTrustedScoringSignalsUri(Uri trustedScoringSignalsUri)

設定賣方受信任信號的 URI 端點,用於擷取廣告素材專屬即時資訊。

繼承方法

公用建構函式

公用方法

build

public AdSelectionConfig build ()

建構一個 AdSelectionConfig 執行個體。

傳回
AdSelectionConfig 此值不能為 null

擲回
NullPointerException 如果任何必要參數為空值

setAdSelectionSignals

public AdSelectionConfig.Builder setAdSelectionSignals (AdSelectionSignals adSelectionSignals)

設定廣告選擇出價產生期間提供給買方的信號。

如未設定,則會預設為空白的 JSON。

詳情請參閱 AdSelectionConfig.getAdSelectionSignals()

參數
adSelectionSignals AdSelectionSignals:此值不能為 null

傳回
AdSelectionConfig.Builder 此值不能為 null

setBuyercontextAds

public AdSelectionConfig.Builder setBuyerContextualAds (Map<AdTechIdentifierContextualAds> buyerContextualAds)

在廣告選擇期間,設定與每個買方對應的內容相關廣告。

如未設定,則會預設為空白地圖。

詳情請參閱 AdSelectionConfig.getBuyerContextualAds() ()}。

參數
buyerContextualAds Map:此值不能為 null

傳回
AdSelectionConfig.Builder 此值不能為 null

setCustomAudience 買家

public AdSelectionConfig.Builder setCustomAudienceBuyers (List<AdTechIdentifier> customAudienceBuyers)

設定允許的買家清單。

詳情請參閱 AdSelectionConfig.getCustomAudienceBuyers()

參數
customAudienceBuyers List:此值不能為 null

傳回
AdSelectionConfig.Builder 此值不能為 null

setDecisionLogicUri

public AdSelectionConfig.Builder setDecisionLogicUri (Uri decisionLogicUri)

設定 URI,用來擷取決策邏輯,以便用於廣告選擇程序。決策 URI 可以是兩種結構定義之一:

  • HTTPS:HTTPS URI 必須是主機與 seller 相符的絕對 URI
  • 預先建構的廣告:廣告選擇服務 URI 符合 ad-selection-prebuilt://ad-selection/<name>?<script-generation-parameters> 格式。FLEDGE 無需網路呼叫,即可產生適當的 JS 指令碼。

    可用的預建指令碼:

    • highest-bid-winsscoreAdsreportResult:這個 JS 會挑選出價最高的廣告來計算評分。如果是報表,指定的 URI 會使用 render_uribid 參數化。你必須在下列參數下方,才能使用這個預建參數:
      • reportingUrl基本報表 URI,稍後會使用 render_uribid 參數化

      例如:如果基本報表網址為「https://www.ssp.com」,ad-selection-prebuilt://ad-selection/highest-bid-wins/?reportingUrl=https://www.ssp.com

詳情請參閱 AdSelectionConfig.getDecisionLogicUri()

參數
decisionLogicUri Uri:此值不能為 null

傳回
AdSelectionConfig.Builder 此值不能為 null

setPerBuyerSignals

public AdSelectionConfig.Builder setPerBuyerSignals (Map<AdTechIdentifierAdSelectionSignals> perBuyerSignals)

設定每個買方在廣告選擇期間提供的信號。

如未設定,則會預設為空白地圖。

詳情請參閱 AdSelectionConfig.getPerBuyerSignals()

參數
perBuyerSignals Map:此值不能為 null

傳回
AdSelectionConfig.Builder 此值不能為 null

setSeller

public AdSelectionConfig.Builder setSeller (AdTechIdentifier seller)

設定賣方 ID。

詳情請參閱 AdSelectionConfig.getSeller()

參數
seller AdTechIdentifier:此值不能為 null

傳回
AdSelectionConfig.Builder 此值不能為 null

setSellerSignals

public AdSelectionConfig.Builder setSellerSignals (AdSelectionSignals sellerSignals)

設定用於修改廣告選擇結果的信號。

如未設定,則會預設為空白的 JSON。

詳情請參閱 AdSelectionConfig.getSellerSignals()

參數
sellerSignals AdSelectionSignals:此值不能為 null

傳回
AdSelectionConfig.Builder 此值不能為 null

setTrustedScoringSignalsUri

public AdSelectionConfig.Builder setTrustedScoringSignalsUri (Uri trustedScoringSignalsUri)

設定賣方受信任信號的 URI 端點,用於擷取廣告素材專屬即時資訊。

如果傳遞 Uri#EMPTY,系統會略過網路呼叫,並將 AdSelectionSignals.EMPTY 傳遞至廣告選擇。

詳情請參閱 AdSelectionConfig.getTrustedScoringSignalsUri()

參數
trustedScoringSignalsUri Uri:此值不能為 null

傳回
AdSelectionConfig.Builder 此值不能為 null