API 级别 34 中添加
也在广告服务扩展 4 中添加

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 setCustomAudienceBuyers(List<AdTechIdentifier> customAudienceBuyers)

设置允许的买方列表。

AdSelectionConfig.Builder setDecisionLogicUri(Uri decisionLogicUri)

设置用于提取决策逻辑以用于广告选择流程的 URI。

AdSelectionConfig.Builder setPerBuyerSignals(Map<AdTechIdentifierAdSelectionSignals> perBuyerSignals)

设置每个买方在广告选择期间提供的信号。

AdSelectionConfig.Builder setSeller(AdTechIdentifier seller)

设置卖方标识符。

AdSelectionConfig.Builder setSellerSignals(AdSelectionSignals sellerSignals)

设置用于修改广告选择结果的信号。

AdSelectionConfig.Builder setTrustedScoringSignalsUri(Uri trustedScoringSignalsUri)

设置卖方可信信号的 URI 端点,可从中提取广告素材专有的实时信息。

继承的方法

公共构造函数

Builder

API 级别 34 中添加
也在广告服务扩展 4 中添加
public Builder ()

公共方法

build

API 级别 34 中添加
也在广告服务扩展 4 中添加
public AdSelectionConfig build ()

构建 AdSelectionConfig 实例。

开球回攻次数
AdSelectionConfig 此值不能为 null

抛出
NullPointerException 如果任何必需参数为 null

setAdSelectionSignals

API 级别 34 中添加
也在广告服务扩展 4 中添加
public AdSelectionConfig.Builder setAdSelectionSignals (AdSelectionSignals adSelectionSignals)

设置在生成广告选择出价期间向买方提供的信号。

如果未设置,则默认为空 JSON。

如需了解详情,请参阅 AdSelectionConfig.getAdSelectionSignals()

参数
adSelectionSignals AdSelectionSignals:此值不能为 null

开球回攻次数
AdSelectionConfig.Builder 此值不能为 null

setCustomAudienceBuyers

API 级别 34 中添加
也在广告服务扩展 4 中添加
public AdSelectionConfig.Builder setCustomAudienceBuyers (List<AdTechIdentifier> customAudienceBuyers)

设置允许的买方列表。

如需了解详情,请参阅 AdSelectionConfig.getCustomAudienceBuyers()

参数
customAudienceBuyers List:此值不能为 null

开球回攻次数
AdSelectionConfig.Builder 此值不能为 null

setDecisionLogicUri

API 级别 34 中添加
也在广告服务扩展 4 中添加
public AdSelectionConfig.Builder setDecisionLogicUri (Uri decisionLogicUri)

设置用于提取决策逻辑以用于广告选择流程的 URI。决策 URI 可以是以下两种架构之一:

  • HTTPS:HTTPS URI 必须是绝对 URI,其中主机与 seller
  • 预构建的广告选择:广告选择服务 URI 遵循 ad-selection-prebuilt://ad-selection/<name>?<script-generation-parameters> 格式。FLEDGE 会生成适当的 JS 脚本,而无需网络调用。

    可用的预构建脚本:

    • scoreAdsreportResulthighest-bid-wins:此 JS 会选择出价最高的广告。对于报告,给定 URI 使用 render_uribid 参数化。如需使用此预构建,必须提供以下参数:
      • reportingUrl:稍后将使用 render_uribid 参数化的基础报告 URI

      例如:如果您的基本报告网址为“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

API 级别 34 中添加
也在广告服务扩展 4 中添加
public AdSelectionConfig.Builder setPerBuyerSignals (Map<AdTechIdentifierAdSelectionSignals> perBuyerSignals)

设置每个买方在广告选择期间提供的信号。

如果未设置,则默认为空地图。

如需了解详情,请参阅 AdSelectionConfig.getPerBuyerSignals()

参数
perBuyerSignals Map:此值不能为 null

开球回攻次数
AdSelectionConfig.Builder 此值不能为 null

setSeller

API 级别 34 中添加
也在广告服务扩展 4 中添加
public AdSelectionConfig.Builder setSeller (AdTechIdentifier seller)

设置卖方标识符。

如需了解详情,请参阅 AdSelectionConfig.getSeller()

参数
seller AdTechIdentifier:此值不能为 null

开球回攻次数
AdSelectionConfig.Builder 此值不能为 null

setSellerSignals

API 级别 34 中添加
也在广告服务扩展 4 中添加
public AdSelectionConfig.Builder setSellerSignals (AdSelectionSignals sellerSignals)

设置用于修改广告选择结果的信号。

如果未设置,则默认为空 JSON。

如需了解详情,请参阅 AdSelectionConfig.getSellerSignals()

参数
sellerSignals AdSelectionSignals:此值不能为 null

开球回攻次数
AdSelectionConfig.Builder 此值不能为 null

setTrustedScoringSignalsUri

API 级别 34 中添加
也在广告服务扩展 4 中添加
public AdSelectionConfig.Builder setTrustedScoringSignalsUri (Uri trustedScoringSignalsUri)

设置卖方可信信号的 URI 端点,可从中提取广告素材专有的实时信息。

如果传递了 Uri#EMPTY,系统会跳过网络调用,并将 AdSelectionSignals.EMPTY 传递给广告选择。

如需了解详情,请参阅 AdSelectionConfig.getTrustedScoringSignalsUri()

参数
trustedScoringSignalsUri Uri:此值不能为 null

开球回攻次数
AdSelectionConfig.Builder 此值不能为 null