# CustomAudience

Artifact: [androidx.privacysandbox.ads:ads-adservices](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads) [View Source](https://cs.android.com/search?q=file:androidx/privacysandbox/ads/adservices/customaudience/CustomAudience.kt+class:androidx.privacysandbox.ads.adservices.customaudience.CustomAudience) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

*** ** * ** ***


```
class CustomAudience
```

<br />

*** ** * ** ***

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 |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience.Builder` Builder for `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience` objects. |

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/ExperimentalFeatures.Ext14OptIn https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience#FLAG_AUCTION_SERVER_REQUEST_DEFAULT() = 0` Default value for auction server request flag. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/ExperimentalFeatures.Ext14OptIn https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience#FLAG_AUCTION_SERVER_REQUEST_OMIT_ADS()` This auction server request flag indicates to the service that ads for this Custom Audience can be omitted in the server auction payload. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html` | `@https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/ExperimentalFeatures.Ext14OptIn https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience#PRIORITY_DEFAULT() = 0.0` Default priority for this custom audience. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience#CustomAudience(androidx.privacysandbox.ads.adservices.common.AdTechIdentifier,kotlin.String,android.net.Uri,android.net.Uri,kotlin.collections.List,java.time.Instant,java.time.Instant,androidx.privacysandbox.ads.adservices.common.AdSelectionSignals,androidx.privacysandbox.ads.adservices.customaudience.TrustedBiddingData)( buyer: https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/AdTechIdentifier, name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, dailyUpdateUri: https://developer.android.com/reference/android/net/Uri.html, biddingLogicUri: https://developer.android.com/reference/android/net/Uri.html, ads: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/AdData>, activationTime: https://developer.android.com/reference/java/time/Instant.html?, expirationTime: https://developer.android.com/reference/java/time/Instant.html?, userBiddingSignals: https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/AdSelectionSignals?, trustedBiddingSignals: https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/TrustedBiddingData? )` Represents the information necessary for a custom audience to participate in ad selection. |
| `@https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/ExperimentalFeatures.Ext14OptIn https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience#CustomAudience(androidx.privacysandbox.ads.adservices.common.AdTechIdentifier,kotlin.String,android.net.Uri,android.net.Uri,kotlin.collections.List,java.time.Instant,java.time.Instant,androidx.privacysandbox.ads.adservices.common.AdSelectionSignals,androidx.privacysandbox.ads.adservices.customaudience.TrustedBiddingData,kotlin.Int,kotlin.Double)( buyer: https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/AdTechIdentifier, name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, dailyUpdateUri: https://developer.android.com/reference/android/net/Uri.html, biddingLogicUri: https://developer.android.com/reference/android/net/Uri.html, ads: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/AdData>, activationTime: https://developer.android.com/reference/java/time/Instant.html?, expirationTime: https://developer.android.com/reference/java/time/Instant.html?, userBiddingSignals: https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/AdSelectionSignals?, trustedBiddingSignals: https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/TrustedBiddingData?, auctionServerRequestFlags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, priority: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html )` |

| ### Public functions |
|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` Checks whether two `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience` objects contain the same information. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience#hashCode()()` Returns the hash of the `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience` object's data. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience#toString()()` |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/java/time/Instant.html?` | `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience#activationTime()` optional activation time may be set in the future, in order to serve a delayed activation. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/AdData>` | `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience#ads()` the list of `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/AdData` objects is a full and complete list of the ads that will be served by this `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience` during the ad selection process. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/ExperimentalFeatures.Ext14OptIn https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience#auctionServerRequestFlags()` the bitfield of auction server request flags. |
| `https://developer.android.com/reference/android/net/Uri.html` | `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience#biddingLogicUri()` the target URI used to fetch bidding logic when a custom audience participates in the ad selection process. |
| `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/AdTechIdentifier` | `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience#buyer()` A buyer is identified by a domain in the form "buyerexample.com". |
| `https://developer.android.com/reference/android/net/Uri.html` | `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience#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. |
| `https://developer.android.com/reference/java/time/Instant.html?` | `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience#expirationTime()` optional expiration time. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience#name()` The custom audience's name is an arbitrary string provided by the owner and buyer on creation of the `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience` object. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html` | `@https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/ExperimentalFeatures.Ext14OptIn https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience#priority()` representing the priority of this custom audience. |
| `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/TrustedBiddingData?` | `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience#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. |
| `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/AdSelectionSignals?` | `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience#userBiddingSignals()` optional User bidding signals, provided by buyers to be consumed by buyer-provided JavaScript during ad selection in an isolated execution environment. |

## Constants

### FLAG_AUCTION_SERVER_REQUEST_DEFAULT

```
@ExperimentalFeatures.Ext14OptIn
const val FLAG_AUCTION_SERVER_REQUEST_DEFAULT = 0: Int
```

Default value for auction server request flag.

### FLAG_AUCTION_SERVER_REQUEST_OMIT_ADS

```
@ExperimentalFeatures.Ext14OptIn
const val FLAG_AUCTION_SERVER_REQUEST_OMIT_ADS: Int
```

This auction server request flag indicates to the service that ads for this Custom Audience can be omitted in the server auction payload.

### PRIORITY_DEFAULT

```
@ExperimentalFeatures.Ext14OptIn
const val PRIORITY_DEFAULT = 0.0: Double
```

Default priority for this custom audience.

## Public constructors

### CustomAudience

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

```
CustomAudience(
    buyer: AdTechIdentifier,
    name: String,
    dailyUpdateUri: Uri,
    biddingLogicUri: Uri,
    ads: List<AdData>,
    activationTime: Instant? = null,
    expirationTime: Instant? = null,
    userBiddingSignals: AdSelectionSignals? = null,
    trustedBiddingSignals: TrustedBiddingData? = null
)
```

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.

| Parameters |
|---|---|
| `buyer: https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/AdTechIdentifier` | A buyer is identified by a domain in the form "buyerexample.com". |
| `name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The custom audience's name is an arbitrary string provided by the owner and buyer on creation of the `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience` object. |
| `dailyUpdateUri: https://developer.android.com/reference/android/net/Uri.html` | 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. |
| `biddingLogicUri: https://developer.android.com/reference/android/net/Uri.html` | the target URI used to fetch bidding logic when a custom audience participates in the ad selection process. The URI must use HTTPS. |
| `ads: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/AdData>` | the list of `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/AdData` objects is a full and complete list of the ads that will be served by this `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience` during the ad selection process. |
| `activationTime: https://developer.android.com/reference/java/time/Instant.html? = null` | 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. |
| `expirationTime: https://developer.android.com/reference/java/time/Instant.html? = null` | 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. |
| `userBiddingSignals: https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/AdSelectionSignals? = null` | optional User bidding signals, provided by buyers to be consumed by buyer-provided JavaScript during ad selection in an isolated execution environment. |
| `trustedBiddingSignals: https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/TrustedBiddingData? = null` | 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. |

### CustomAudience

Added in [1.1.0-beta12](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.1.0-beta12)

```
@ExperimentalFeatures.Ext14OptIn
CustomAudience(
    buyer: AdTechIdentifier,
    name: String,
    dailyUpdateUri: Uri,
    biddingLogicUri: Uri,
    ads: List<AdData>,
    activationTime: Instant? = null,
    expirationTime: Instant? = null,
    userBiddingSignals: AdSelectionSignals? = null,
    trustedBiddingSignals: TrustedBiddingData? = null,
    auctionServerRequestFlags: Int = 0,
    priority: Double = 0.0
)
```

| Parameters |
|---|---|
| `buyer: https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/AdTechIdentifier` | A buyer is identified by a domain in the form "buyerexample.com". |
| `name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The custom audience's name is an arbitrary string provided by the owner and buyer on creation of the `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience` object. |
| `dailyUpdateUri: https://developer.android.com/reference/android/net/Uri.html` | 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. |
| `biddingLogicUri: https://developer.android.com/reference/android/net/Uri.html` | the target URI used to fetch bidding logic when a custom audience participates in the ad selection process. The URI must use HTTPS. |
| `ads: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/AdData>` | the list of `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/AdData` objects is a full and complete list of the ads that will be served by this `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience` during the ad selection process. |
| `activationTime: https://developer.android.com/reference/java/time/Instant.html? = null` | 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. |
| `expirationTime: https://developer.android.com/reference/java/time/Instant.html? = null` | 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. |
| `userBiddingSignals: https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/AdSelectionSignals? = null` | optional User bidding signals, provided by buyers to be consumed by buyer-provided JavaScript during ad selection in an isolated execution environment. |
| `trustedBiddingSignals: https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/TrustedBiddingData? = null` | 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. |
| `auctionServerRequestFlags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = 0` | the bitfield of auction server request flags. These are flags that influence the creation of the payload generated by the getAdSelectionData API. Value is either `0` or a combination of the following: - `0` - `1` <br /> |
| `priority: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html = 0.0` | representing the priority of this custom audience. If there is insufficient space during the buyer input generation in the getAdSelectionData call, the service will attempt to include the highest priority custom audiences first. |

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```

Checks whether two `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience` objects contain the same information.

### hashCode

```
open fun hashCode(): Int
```

Returns the hash of the `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience` object's data.

### toString

```
open fun toString(): String
```

## Public properties

### activationTime

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

```
val activationTime: Instant?
```

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.

### ads

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

```
val ads: List<AdData>
```

the list of `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/common/AdData` objects is a full and complete list of the ads that will be served by this `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience` during the ad selection process.

### auctionServerRequestFlags

Added in [1.1.0-beta12](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.1.0-beta12)

```
@ExperimentalFeatures.Ext14OptIn
val auctionServerRequestFlags: Int
```

the bitfield of auction server request flags. These are flags that influence the creation of the payload generated by the getAdSelectionData API.

Value is either `0` or a combination of the following:

- `0`
- `1`

<br />

### biddingLogicUri

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

```
val biddingLogicUri: Uri
```

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

### buyer

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

```
val buyer: AdTechIdentifier
```

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

### dailyUpdateUri

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

```
val dailyUpdateUri: 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. The URI must use HTTPS.

### expirationTime

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

```
val expirationTime: Instant?
```

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.

### name

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

```
val name: String
```

The custom audience's name is an arbitrary string provided by the owner and buyer on creation of the `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/customaudience/CustomAudience` object.

### priority

Added in [1.1.0-beta12](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.1.0-beta12)

```
@ExperimentalFeatures.Ext14OptIn
val priority: Double
```

representing the priority of this custom audience. If there is insufficient space during the buyer input generation in the getAdSelectionData call, the service will attempt to include the highest priority custom audiences first.

### trustedBiddingSignals

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

```
val trustedBiddingSignals: 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.

### userBiddingSignals

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

```
val userBiddingSignals: AdSelectionSignals?
```

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