public final class CustomAudience


Represents the information necessary for a custom audience to participate in ad selection.

A custom audience is an abstract grouping of users with similar demonstrated interests. This class is a collection of some data stored on a device that is necessary to serve advertisements targeting a single custom audience.

Summary

Nested types

public final class CustomAudience.Builder

Builder for CustomAudience objects.

Public constructors

CustomAudience(
    @NonNull AdTechIdentifier buyer,
    @NonNull String name,
    @NonNull Uri dailyUpdateUri,
    @NonNull Uri biddingLogicUri,
    @NonNull List<@NonNull AdData> ads,
    Instant activationTime,
    Instant expirationTime,
    AdSelectionSignals userBiddingSignals,
    TrustedBiddingData trustedBiddingSignals
)

Public methods

boolean
equals(Object other)

Checks whether two CustomAudience objects contain the same information.

final Instant

optional activation time may be set in the future, in order to serve a delayed activation.

final @NonNull List<@NonNull AdData>

the list of AdData objects is a full and complete list of the ads that will be served by this CustomAudience during the ad selection process.

final @NonNull Uri

the target URI used to fetch bidding logic when a custom audience participates in the ad selection process.

final @NonNull AdTechIdentifier

A buyer is identified by a domain in the form "buyerexample.com".

final @NonNull Uri

a URI that points to a buyer-operated server that hosts updated bidding data and ads metadata to be used in the on-device ad selection process.

final Instant

optional expiration time.

final @NonNull String

The custom audience's name is an arbitrary string provided by the owner and buyer on creation of the CustomAudience object.

final TrustedBiddingData

optional trusted bidding data, consists of a URI pointing to a trusted server for buyers' bidding data and a list of keys to query the server with.

final AdSelectionSignals

optional User bidding signals, provided by buyers to be consumed by buyer-provided JavaScript during ad selection in an isolated execution environment.

int

Returns the hash of the CustomAudience object's data.

@NonNull String

Public constructors

CustomAudience

Added in 1.0.0
public CustomAudience(
    @NonNull AdTechIdentifier buyer,
    @NonNull String name,
    @NonNull Uri dailyUpdateUri,
    @NonNull Uri biddingLogicUri,
    @NonNull List<@NonNull AdData> ads,
    Instant activationTime,
    Instant expirationTime,
    AdSelectionSignals userBiddingSignals,
    TrustedBiddingData trustedBiddingSignals
)
Parameters
@NonNull AdTechIdentifier buyer

A buyer is identified by a domain in the form "buyerexample.com".

@NonNull String name

The custom audience's name is an arbitrary string provided by the owner and buyer on creation of the CustomAudience object.

@NonNull Uri dailyUpdateUri

a URI that points to a buyer-operated server that hosts updated bidding data and ads metadata to be used in the on-device ad selection process. The URI must use HTTPS.

@NonNull Uri biddingLogicUri

the target URI used to fetch bidding logic when a custom audience participates in the ad selection process. The URI must use HTTPS.

@NonNull List<@NonNull AdData> ads

the list of AdData objects is a full and complete list of the ads that will be served by this CustomAudience during the ad selection process.

Instant activationTime

optional activation time may be set in the future, in order to serve a delayed activation. If the field is not set, the object will be activated at the time of joining.

Instant expirationTime

optional expiration time. Once it has passed, a custom audience is no longer eligible for daily ad/bidding data updates or participation in the ad selection process. The custom audience will then be deleted from memory by the next daily update.

AdSelectionSignals userBiddingSignals

optional User bidding signals, provided by buyers to be consumed by buyer-provided JavaScript during ad selection in an isolated execution environment.

TrustedBiddingData trustedBiddingSignals

optional trusted bidding data, consists of a URI pointing to a trusted server for buyers' bidding data and a list of keys to query the server with.

Public methods

equals

public boolean equals(Object other)

Checks whether two CustomAudience objects contain the same information.

getActivationTime

Added in 1.0.0
public final Instant getActivationTime()

optional activation time may be set in the future, in order to serve a delayed activation. If the field is not set, the object will be activated at the time of joining.

getAds

Added in 1.0.0
public final @NonNull List<@NonNull AdDatagetAds()

the list of AdData objects is a full and complete list of the ads that will be served by this CustomAudience during the ad selection process.

getBiddingLogicUri

Added in 1.0.0
public final @NonNull Uri getBiddingLogicUri()

the target URI used to fetch bidding logic when a custom audience participates in the ad selection process. The URI must use HTTPS.

getBuyer

Added in 1.0.0
public final @NonNull AdTechIdentifier getBuyer()

A buyer is identified by a domain in the form "buyerexample.com".

getDailyUpdateUri

Added in 1.0.0
public final @NonNull Uri getDailyUpdateUri()

a URI that points to a buyer-operated server that hosts updated bidding data and ads metadata to be used in the on-device ad selection process. The URI must use HTTPS.

getExpirationTime

Added in 1.0.0
public final Instant getExpirationTime()

optional expiration time. Once it has passed, a custom audience is no longer eligible for daily ad/bidding data updates or participation in the ad selection process. The custom audience will then be deleted from memory by the next daily update.

getName

Added in 1.0.0
public final @NonNull String getName()

The custom audience's name is an arbitrary string provided by the owner and buyer on creation of the CustomAudience object.

getTrustedBiddingSignals

Added in 1.0.0
public final TrustedBiddingData getTrustedBiddingSignals()

optional trusted bidding data, consists of a URI pointing to a trusted server for buyers' bidding data and a list of keys to query the server with.

getUserBiddingSignals

Added in 1.0.0
public final AdSelectionSignals getUserBiddingSignals()

optional User bidding signals, provided by buyers to be consumed by buyer-provided JavaScript during ad selection in an isolated execution environment.

hashCode

public int hashCode()

Returns the hash of the CustomAudience object's data.

toString

public @NonNull String toString()