AdSelectionFromOutcomesConfig.Builder

public static final class AdSelectionFromOutcomesConfig.Builder
extends Object

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


Builder for AdSelectionFromOutcomesConfig objects. All fields require non-null values to build.

Summary

Public constructors

Builder()

Public methods

AdSelectionFromOutcomesConfig build()

Builds a AdSelectionFromOutcomesConfig instance.

AdSelectionFromOutcomesConfig.Builder setAdSelectionIds(List<Long> adSelectionIds)

Sets the list of AdSelectionIds to participate in the selection process.

AdSelectionFromOutcomesConfig.Builder setSelectionLogicUri(Uri selectionLogicUri)

Sets the SelectionLogicUri.

AdSelectionFromOutcomesConfig.Builder setSelectionSignals(AdSelectionSignals selectionSignals)

Sets the SelectionSignals to be consumed by the JS script downloaded from SelectionLogicUri

AdSelectionFromOutcomesConfig.Builder setSeller(AdTechIdentifier seller)

Sets the seller AdTechIdentifier.

Inherited methods

Public constructors

Builder

public Builder ()

Public methods

build

public AdSelectionFromOutcomesConfig build ()

Builds a AdSelectionFromOutcomesConfig instance.

Returns
AdSelectionFromOutcomesConfig This value cannot be null.

setAdSelectionIds

public AdSelectionFromOutcomesConfig.Builder setAdSelectionIds (List<Long> adSelectionIds)

Sets the list of AdSelectionIds to participate in the selection process.

Parameters
adSelectionIds List: This value cannot be null.

Returns
AdSelectionFromOutcomesConfig.Builder This value cannot be null.

setSelectionLogicUri

public AdSelectionFromOutcomesConfig.Builder setSelectionLogicUri (Uri selectionLogicUri)

Sets the SelectionLogicUri. Selection 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-from-outcomes/<name>?<script-generation-parameters> format. FLEDGE generates the appropriate JS script without the need for a network call.

    Available prebuilt scripts:

    • waterfall-mediation-truncation for selectOutcome: This JS implements Waterfall mediation truncation logic. Mediation SDK's ad is returned if its bid greater than or equal to the bid floor. Below parameter(s) are required to use this prebuilt:

      Ex. If your selection signals look like {"bid_floor": 10} then, ad-selection-prebuilt://ad-selection-from-outcomes/waterfall-mediation-truncation/?bidFloor=bid_floor

AdSelectionIds and SelectionSignals.

Parameters
selectionLogicUri Uri: This value cannot be null.

Returns
AdSelectionFromOutcomesConfig.Builder This value cannot be null.

setSelectionSignals

public AdSelectionFromOutcomesConfig.Builder setSelectionSignals (AdSelectionSignals selectionSignals)

Sets the SelectionSignals to be consumed by the JS script downloaded from SelectionLogicUri

Parameters
selectionSignals AdSelectionSignals: This value cannot be null.

Returns
AdSelectionFromOutcomesConfig.Builder This value cannot be null.

setSeller

public AdSelectionFromOutcomesConfig.Builder setSeller (AdTechIdentifier seller)

Sets the seller AdTechIdentifier.

Parameters
seller AdTechIdentifier: This value cannot be null.

Returns
AdSelectionFromOutcomesConfig.Builder This value cannot be null.