<br />

This guide explains how to provide targeting information to the Google Mobile
Ads SDK.
For a working example, download the Android API Demo app.

<br />

[Download API Demo](https://github.com/googleads/googleads-mobile-android-examples/releases/latest)


## Prerequisite

Before you continue, [set up Google Mobile Ads SDK (Legacy)](https://developers.google.com/ad-manager/mobile-ads-sdk/android/quick-start.md.txt).

## RequestConfiguration

[`RequestConfiguration`](https://developers.google.com/ad-manager/mobile-ads-sdk/android/reference/com/google/android/gms/ads/RequestConfiguration.md.txt)
collects targeting information applied globally to every ad request. For
available targeting tags, refer to the
[`RequestConfiguration.Builder`](https://developers.google.com/ad-manager/mobile-ads-sdk/android/reference/com/google/android/gms/ads/RequestConfiguration.Builder.md.txt)
documentation.

To update the request configuration, obtain a builder from the existing
configuration, perform any selected updates, and set it as follows:

### Kotlin

```kotlin
val requestConfiguration = MobileAds.getRequestConfiguration()
MobileAds.setRequestConfiguration(requestConfiguration)
```

### Java

```java
RequestConfiguration requestConfiguration = MobileAds.getRequestConfiguration();
MobileAds.setRequestConfiguration(requestConfiguration);
```

To ensure that all ad requests apply the request configuration changes, set
the request configuration before you
[Initialize Google Mobile Ads SDK (Legacy)](https://developers.google.com/ad-manager/mobile-ads-sdk/android/quick-start.md.txt#initialize_the_mobile_ads_sdk).

### Set the age treatment

To help you manage your compliance with applicable privacy regulations related
to children and teens, Google Mobile Ads SDK (Legacy) provides an age treatment setting. The
age treatment setting lets you indicate whether Google Mobile Ads SDK (Legacy) should apply
specific ad serving protections for children, teens, or an unspecified age.

You can set age treatment with the `setAgeRestrictedTreatment()` method with the
[`RequestConfiguration.Builder`](https://developers.google.com/ad-manager/mobile-ads-sdk/android/reference/com/google/android/gms/ads/RequestConfiguration.Builder.md.txt)
API.

The following example indicates that ad requests should receive child age
treatment:

### Kotlin

```kotlin
val requestConfiguration =
  MobileAds.getRequestConfiguration()
    .toBuilder()
    // Indicate that ad requests should have child age treatment.
    .setAgeRestrictedTreatment(AgeRestrictedTreatment.CHILD)
    .build()
MobileAds.setRequestConfiguration(requestConfiguration)
```

### Java

```java
RequestConfiguration requestConfiguration =
    MobileAds.getRequestConfiguration().toBuilder()
        // Indicate that ad requests should have child age treatment.
        .setAgeRestrictedTreatment(AgeRestrictedTreatment.CHILD)
        .build();
MobileAds.setRequestConfiguration(requestConfiguration);
```

To indicate teen or an unspecified age treatment, replace the `CHILD` setting
with the following:

- `TEEN`
- `UNSPECIFIED`

When using the setting, Google Mobile Ads SDK (Legacy) includes a `tfat` parameter in ad
requests. Consult your legal counsel to determine the applicable age treatment
for your users based on your
legal and regulatory obligations. For more information, see
[Tag an ad request for age treatment](https://support.google.com/admanager/answer/3671211).

#### Migrate to age treatment from TFCD and TFUA

The age treatment setting replaces the deprecated
`.setTagForChildDirectedTreatment()` (TFCD) and `.setTagForUnderAgeOfConsent()`
(TFUA) settings.

The following table shows the TFCD and TFUA settings and their age treatment
equivalents:

### TFCD

| `TFCD` | Age treatment |
|---|---|
| `TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUE` | `AgeRestrictedTreatment.CHILD` |
| `TAG_FOR_CHILD_DIRECTED_TREATMENT_FALSE` | `AgeRestrictedTreatment.UNSPECIFIED` |
| `TAG_FOR_CHILD_DIRECTED_TREATMENT_UNSPECIFIED` | `AgeRestrictedTreatment.UNSPECIFIED` |
| No value assigned `.setTagForChildDirectedTreatment()` | `AgeRestrictedTreatment.UNSPECIFIED` |
| No equivalent | `AgeRestrictedTreatment.TEEN` |

### TFUA

| `TFUA` | Age treatment |
|---|---|
| `TAG_FOR_UNDER_AGE_OF_CONSENT_TRUE` | `AgeRestrictedTreatment.CHILD` |
| `TAG_FOR_UNDER_AGE_OF_CONSENT_FALSE` | `AgeRestrictedTreatment.UNSPECIFIED` |
| `TAG_FOR_UNDER_AGE_OF_CONSENT_UNSPECIFIED` | `AgeRestrictedTreatment.UNSPECIFIED` |
| No value assigned `.setTagForUnderAgeOfConsent()` | `AgeRestrictedTreatment.UNSPECIFIED` |
| No equivalent | `AgeRestrictedTreatment.TEEN` |

#### Understand age treatment interactions with TFCD and TFUA

If you set age treatment setting and TFCD or TFUA settings, Google applies the
most conservative treatment.

> [!NOTE]
> **Note:** Apps in the [Designed For Families
> Program](https://developer.android.com/distribute/google-play/families) as [Primarily child-directed apps](https://support.google.com/admanager/answer/9467073) and users signed into Google Accounts managed with [Family
> Link](https://families.google.com/familylink/) automatically have all content treated as child-directed for all ad requests.

#### Forward age treatment with mediation

If you [set the age treatment](https://developers.google.com/ad-manager/mobile-ads-sdk/android/targeting.md.txt#set_the_age_treatment) using Google Mobile Ads SDK (Legacy),
mediation adapters forward the age treatment signal to mediated third-party
SDKs.

The following table lists the mediation adapter versions that support forwarding
the age-restricted treatment signal to the mediated third-party SDK:

| Mediation adapter name | Minimum supported version |
|---|---|
| [AppLovin](https://developers.google.com/ad-manager/mobile-ads-sdk/android/mediation/applovin.md.txt) | 13.6.3.0 |
| [BidMachine](https://developers.google.com/ad-manager/mobile-ads-sdk/android/mediation/bidmachine.md.txt) | 3.7.1.1 |
| [Bigo](https://developers.google.com/ad-manager/mobile-ads-sdk/android/mediation/bigo.md.txt) | 5.9.0.1 |
| [Chartboost](https://developers.google.com/ad-manager/mobile-ads-sdk/android/mediation/chartboost.md.txt) | 9.12.1.1 |
| [DTExchange (Fyber)](https://developers.google.com/ad-manager/mobile-ads-sdk/android/mediation/dt-exchange.md.txt) | 8.4.5.1 |
| [i-mobile](https://developers.google.com/ad-manager/mobile-ads-sdk/android/mediation/imobile.md.txt) | 2.3.2.4 |
| [InMobi](https://developers.google.com/ad-manager/mobile-ads-sdk/android/mediation/inmobi.md.txt) | 11.3.0.1 |
| [IronSource](https://developers.google.com/ad-manager/mobile-ads-sdk/android/mediation/ironsource.md.txt) | 9.4.3.0 |
| [Liftoff Monetize (Vungle)](https://developers.google.com/ad-manager/mobile-ads-sdk/android/mediation/liftoff-monetize.md.txt) | 7.7.4.2 |
| [LY (Line)](https://developers.google.com/ad-manager/mobile-ads-sdk/android/mediation/line.md.txt) | 3.1.1.1 |
| [maio](https://developers.google.com/ad-manager/mobile-ads-sdk/android/mediation/maio.md.txt) | 2.0.9.0 |
| [Meta (Facebook)](https://developers.google.com/ad-manager/mobile-ads-sdk/android/mediation/meta.md.txt) | 6.21.0.4 |
| [Mintegral](https://developers.google.com/ad-manager/mobile-ads-sdk/android/mediation/mintegral.md.txt) | 17.1.61.1 |
| [Moloco](https://developers.google.com/ad-manager/mobile-ads-sdk/android/mediation/moloco.md.txt) | 4.10.0.0 |
| [MyTarget](https://developers.google.com/ad-manager/mobile-ads-sdk/android/mediation/mytarget.md.txt) | 5.47.1.1 |
| [Pangle](https://developers.google.com/ad-manager/mobile-ads-sdk/android/mediation/pangle.md.txt) | 8.1.0.3.1 |
| [PubMatic](https://developers.google.com/ad-manager/mobile-ads-sdk/android/mediation/pubmatic.md.txt) | 5.1.2.2 |
| [Verve](https://developers.google.com/ad-manager/mobile-ads-sdk/android/mediation/verve.md.txt) | 3.9.0.0 |

### Child-directed setting

> [!WARNING]
> **Warning:** The `setTagForChildDirectedTreatment()` method is deprecated. Instead, [set the `setAgeRestrictedTreatment()`](https://developers.google.com/ad-manager/mobile-ads-sdk/android/targeting.md.txt#set_the_age_treatment) method.

For purposes of the [Children's Online Privacy Protection Act
(COPPA)](https://www.ftc.gov/tips-advice/business-center/privacy-and-security/children%27s-privacy),
there is a setting called "tag for child-directed treatment".
By setting this tag, you certify that this notification is accurate
and you are authorized to act on behalf of the owner of the app.
You understand that abuse of this setting may result in termination
of your Google Account.

As an app developer, you can indicate whether you want Google to treat your
content as child-directed when you make an ad request. If you indicate that you
want Google to treat your content as child-directed, we take steps to
disable IBA and remarketing ads on that ad request.

You can apply the child-directed setting through

[`setTagForChildDirectedTreatment()`](https://developers.google.com/ad-manager/mobile-ads-sdk/android/reference/com/google/android/gms/ads/RequestConfiguration.Builder.md.txt#setTagForChildDirectedTreatment(int)):


- Call `setTagForChildDirectedTreatment` with
  `TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUE` to indicate that you want your
  content treated as child-directed for purposes of COPPA. This prevents
  the transmission of the [Android advertising identifier
  (AAID)](https://support.google.com/googleplay/android-developer/answer/6048248).

- Call `setTagForChildDirectedTreatment` with
  `TAG_FOR_CHILD_DIRECTED_TREATMENT_FALSE` to indicate that you don't want your
  content treated as child-directed for purposes of COPPA.

- Call `setTagForChildDirectedTreatment` with
  `TAG_FOR_CHILD_DIRECTED_TREATMENT_UNSPECIFIED` if you don't want to indicate
  how you would like your content treated with respect to COPPA in ad requests.

The following example indicates that you want your content treated as
child-directed for purposes of COPPA:

### Kotlin

```kotlin
val requestConfiguration =
  MobileAds.getRequestConfiguration()
    .toBuilder()
    .setTagForChildDirectedTreatment(RequestConfiguration.TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUE)
    .build()
MobileAds.setRequestConfiguration(requestConfiguration)
```

### Java

```java
RequestConfiguration requestConfiguration =
    MobileAds.getRequestConfiguration().toBuilder()
        .setTagForChildDirectedTreatment(
            RequestConfiguration.TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUE)
        .build();
MobileAds.setRequestConfiguration(requestConfiguration);
```

> [!NOTE]
> **Note:** Apps in the [Designed For Families
> Program](https://developer.android.com/distribute/google-play/families) as [Primarily child-directed apps](https://support.google.com/admanager/answer/9467073) and users signed into Google Accounts managed with [Family
> Link](https://families.google.com/familylink/) automatically have all content treated as child-directed for all ad requests.

### Users under the age of consent

> [!WARNING]
> **Warning:** The `setTagForUnderAgeOfConsent()` method is deprecated. Instead, [set
> the `setAgeRestrictedTreatment()`](https://developers.google.com/ad-manager/mobile-ads-sdk/android/targeting#set_the_age_treatment) method.


You can mark your ad requests to receive treatment for users in the
European Economic Area (EEA) under the age of consent. This feature is
designed to help facilitate compliance with the [General
Data Protection Regulation (GDPR)](https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:32016R0679). You may have other legal
obligations under GDPR. Review European Union guidance and consult with
your own legal counsel. Google's tools are designed to facilitate
compliance and don't relieve any particular publisher of its obligations under
the law.


[Learn more about how the GDPR affects publishers](https://support.google.com/admanager/answer/7666366).


When using this feature, a Tag For Users under the Age of Consent in Europe
(TFUA) parameter is included in the ad request. This parameter disables
personalized advertising, including remarketing, for all ad requests. It also
disables requests to third-party ad vendors, such as ad measurement pixels and
third-party ad servers.

Like child-directed settings, there is a method in
`RequestConfiguration.Builder` for setting the TFUA parameter:

[`setTagForUnderAgeOfConsent()`](https://developers.google.com/ad-manager/mobile-ads-sdk/android/reference/com/google/android/gms/ads/RequestConfiguration.Builder.md.txt#setTagForUnderAgeOfConsent(int)),

with the following options.

- Call `setTagForUnderAgeOfConsent()` with `TAG_FOR_UNDER_AGE_OF_CONSENT_TRUE`
  to indicate that you want the ad request to receive treatment for users in
  the European Economic Area (EEA) under the age of consent. This also
  prevents the transmission of the [Android advertising identifier
  (AAID)](https://support.google.com/googleplay/android-developer/answer/6048248).

- Call `setTagForUnderAgeOfConsent()` with `TAG_FOR_UNDER_AGE_OF_CONSENT_FALSE`
  to indicate that you want the ad request to *not* receive treatment for users
  in the European Economic Area (EEA) under the age of consent.

- Call `setTagForUnderAgeOfConsent()` with
  `TAG_FOR_UNDER_AGE_OF_CONSENT_UNSPECIFIED` to indicate that you have not
  specified whether the ad request should receive treatment for users in the
  European Economic Area (EEA) under the age of consent.

The following example indicates that you want TFUA included in your ad requests:

### Kotlin

```kotlin
val requestConfiguration =
  MobileAds.getRequestConfiguration()
    .toBuilder()
    .setTagForUnderAgeOfConsent(RequestConfiguration.TAG_FOR_UNDER_AGE_OF_CONSENT_TRUE)
    .build()
MobileAds.setRequestConfiguration(requestConfiguration)
```

### Java

```java
RequestConfiguration requestConfiguration =
    MobileAds.getRequestConfiguration().toBuilder()
        .setTagForUnderAgeOfConsent(RequestConfiguration.TAG_FOR_UNDER_AGE_OF_CONSENT_TRUE)
        .build();
MobileAds.setRequestConfiguration(requestConfiguration);
```

The tags to enable the [Child-directed setting](https://developers.google.com/ad-manager/mobile-ads-sdk/android/targeting.md.txt#child-directed_setting)
and `setTagForUnderAgeOfConsent()` shouldn't both simultaneously be set to
`true`. If they are, the child-directed setting takes precedence.

### Ad content filtering

To comply with Google Play's [Inappropriate Ads Policy](https://support.google.com/googleplay/android-developer/answer/9857753#zippy=%2Cexamples-of-common-violations)
that includes associated offers within an ad, all ads and their associated
offers shown within your app must be appropriate for the [content
rating](https://support.google.com/googleplay/android-developer/answer/9898843) of
your app, even if the content by itself is otherwise compliant with Google
Play's policies.

Tools like maximum ad content rating can help you have more control over the
content of the ads shown to your users. You can set a maximum content rating to
help compliance with platform policies.

Apps can set a maximum ad content rating for their ad requests using the

[`setMaxAdContentRating`](https://developers.google.com/ad-manager/mobile-ads-sdk/android/reference/com/google/android/gms/ads/RequestConfiguration.Builder.md.txt#setMaxAdContentRating(java.lang.String))

method. AdMob ads returned when this is configured have a content rating at or
lower than that level. The possible values for this network extra are based on
[digital content label classifications](https://support.google.com/admob/answer/7562142), and must be one of the following
strings:

- `MAX_AD_CONTENT_RATING_G`
- `MAX_AD_CONTENT_RATING_PG`
- `MAX_AD_CONTENT_RATING_T`
- `MAX_AD_CONTENT_RATING_MA`

The following code configures an `RequestConfiguration` object to specify that
ad content returned should correspond to a digital content label designation no
higher than `G`:

### Kotlin

```kotlin
val requestConfiguration =
  MobileAds.getRequestConfiguration()
    .toBuilder()
    .setMaxAdContentRating(RequestConfiguration.MAX_AD_CONTENT_RATING_G)
    .build()
MobileAds.setRequestConfiguration(requestConfiguration)
```

### Java

```java
RequestConfiguration requestConfiguration =
    MobileAds.getRequestConfiguration().toBuilder()
        .setMaxAdContentRating(RequestConfiguration.MAX_AD_CONTENT_RATING_G)
        .build();
MobileAds.setRequestConfiguration(requestConfiguration);
```

Learn more about [setting the maximum content rating for each ad
request](https://support.google.com/admanager/answer/12375142).

> [!NOTE]
> **Note:** Content rating filter settings specified through Google Mobile Ads SDK (Legacy) override any settings configured using the Ad Manager UI.

### Publisher Privacy Treatment (Beta)

The

[Publisher Privacy Treatment](https://support.google.com/admanager/answer/14323214)

(PPT) API is an optional tool that lets apps indicate whether to turn off ads
personalization for all ad requests using the

[`setPublisherPrivacyPersonalizationState()`](https://developers.google.com/ad-manager/mobile-ads-sdk/android/reference/com/google/android/gms/ads/RequestConfiguration.PublisherPrivacyPersonalizationState.md.txt)
method. When using this feature, a publisher privacy treatment (PPT)
parameter is included in all future ad requests for the remainder of the session.

By default, ad requests to Google are served personalized ads. The following
code turns off ads personalization for all ad requests:

### Kotlin

```kotlin
val requestConfiguration =
  MobileAds.getRequestConfiguration()
    .toBuilder()
    .setPublisherPrivacyPersonalizationState(
      RequestConfiguration.PublisherPrivacyPersonalizationState.DISABLED
    )
    .build()
MobileAds.setRequestConfiguration(requestConfiguration)
```

### Java

```java
RequestConfiguration requestConfiguration =
    MobileAds.getRequestConfiguration().toBuilder()
        .setPublisherPrivacyPersonalizationState(
            RequestConfiguration.PublisherPrivacyPersonalizationState.DISABLED)
        .build();
MobileAds.setRequestConfiguration(requestConfiguration);
```

> [!NOTE]
> **Note:** For ad requests with multiple user privacy signals, the most restrictive signal will take precedence. See the [Publisher Privacy Treatment API](https://support.google.com/admanager/answer/14323214) documentation for specific examples.

## Ad request

The
`AdManagerAdRequest` object collects targeting information to be sent
with an ad request.

### Add network extras

Network extras are extra details sent with an ad request that are specific to
a single ad source.

The following code snippet sets an extra parameter key of `collapsible` with
a value of `bottom` to Google:

### Kotlin

```kotlin
val extras = Bundle()
extras.putString("collapsible", "bottom")
val adRequest =
  AdRequest.Builder().addNetworkExtrasBundle(AdMobAdapter::class.java, extras).build()
adView.loadAd(adRequest)
```

### Java

```java
Bundle extras = new Bundle();
extras.putString("collapsible", "bottom");
AdRequest adRequest =
    new AdRequest.Builder().addNetworkExtrasBundle(AdMobAdapter.class, extras).build();
adView.loadAd(adRequest);
```

### Custom targeting

You can pass custom key-value pairs to target Google Ad Manager campaigns (line
items). The following example passes a custom key-value pair in an ad request:

### Kotlin

```kotlin
// Example: Pass custom targeting "age=25".
val newRequest = AdManagerAdRequest.Builder().addCustomTargeting("age", "25").build()
```

### Java

```java
// Example: Pass custom targeting "age=25".
AdManagerAdRequest newRequest =
    new AdManagerAdRequest.Builder().addCustomTargeting("age", "25").build();
```

<br />

You can pass multiple values for a key as a list of strings. For example, to
target individuals in their mid-twenties rather than just 25 year olds.

### Kotlin

```kotlin
.addCustomTargeting("age", listOf("24", "25", "26"))
```

### Java

```java
.addCustomTargeting("age", Arrays.asList("24", "25", "26"))
```

<br />

Check out the [Ad Manager Custom Targeting example](https://github.com/googleads/googleads-mobile-android-examples/blob/main/java/advanced/APIDemo/app/src/main/java/com/google/android/gms/example/apidemo/AdManagerCustomTargetingFragment.java) for an implementation of custom targeting in the Android API Demo app.

### Category exclusions

You can add a slot-level category exclusion level to a request by using the
[`addCategoryExclusion()`](https://developers.google.com/ad-manager/mobile-ads-sdk/android/reference/com/google/android/gms/ads/admanager/AdManagerAdRequest.Builder.md.txt#addCategoryExclusion(java.lang.String))
method:

### Kotlin

```kotlin
// Example: Exclude "automobile" and "boat" categories.
val newRequest =
  AdManagerAdRequest.Builder()
    .addCategoryExclusion("automobile")
    .addCategoryExclusion("boat")
    .build()
```

### Java

```java
// Example: Exclude "automobile" and "boat" categories.
AdManagerAdRequest newRequest =
    new AdManagerAdRequest.Builder()
        .addCategoryExclusion("automobile")
        .addCategoryExclusion("boat")
        .build();
```

<br />

Check out the [Ad Manager Category Exclusions example](https://github.com/googleads/googleads-mobile-android-examples/blob/main/java/advanced/APIDemo/app/src/main/java/com/google/android/gms/example/apidemo/AdManagerCategoryExclusionFragment.java)
for an implementation of category exclusions in the Android API Demo app.

## Publisher provided identifiers

You can set a publisher provided identifier (PPID) for use in frequency capping,
audience segmentation and targeting, sequential ad rotation, and other
audience-based ad delivery controls across devices.

> [!NOTE]
> **Note:** This feature is not available to all publishers. Refer to [About publisher
> provided identifiers](https://support.google.com/admanager/answer/2880055) for details.

Here's an example of setting the PPID:

### Kotlin

```kotlin
val adRequest = AdManagerAdRequest.Builder().setPublisherProvidedId("AB123456789").build()
```

### Java

```java
AdManagerAdRequest adRequest =
    new AdManagerAdRequest.Builder().setPublisherProvidedId("AB123456789").build();
```

<br />

Check out the [Ad Manager PPID example](https://github.com/googleads/googleads-mobile-android-examples/blob/main/java/advanced/APIDemo/app/src/main/java/com/google/android/gms/example/apidemo/AdManagerPPIDFragment.java)
for an implementation of publisher provided identifiers (PPID) in the Android
API Demo app.

## Publisher provided signals

You can send audience and contextual data as
[publisher provided signals](https://support.google.com/admanager/answer/12451124)
(PPS) in ad requests. With PPS, you can use your user data to improve
programmatic monetization by communicating your audience characteristics to
bidders in all
[transaction types](https://support.google.com/admanager/answer/2805834), using
standard taxonomies, without the need to share user identifiers. Your audience
characteristics can include behavioral and interest-based data ([IAB Audience
Taxonomy 1.1](https://iabtechlab.com/standards/audience-taxonomy/)) and contextual
data ([IAB Content Taxonomy 2.2](https://iabtechlab.com/standards/content-taxonomy/)).

### Kotlin

```kotlin
val extras = Bundle()
// Set the demographic to an audience with an "Age Range" of 30-34 and an
// interest in mergers and acquisitions.
extras.putIntegerArrayList("IAB_AUDIENCE_1_1", arrayListOf(6, 284))
// Set the content to sedan, station wagon and SUV automotive values.
extras.putIntegerArrayList("IAB_CONTENT_2_2", arrayListOf(4, 5, 6))

val request =
  AdManagerAdRequest.Builder().addNetworkExtrasBundle(AdMobAdapter::class.java, extras).build()
```

### Java

```java
Bundle extras = new Bundle();
// Set the demographic to an audience with an "Age Range" of 30-34 and an
// interest in mergers and acquisitions.
extras.putIntegerArrayList("IAB_AUDIENCE_1_1", new ArrayList<>(Arrays.asList(6, 284)));
// Set the content to sedan, station wagon and SUV automotive values.
extras.putIntegerArrayList("IAB_CONTENT_2_2", new ArrayList<>(Arrays.asList(4, 5, 6)));

AdManagerAdRequest request =
    new AdManagerAdRequest.Builder().addNetworkExtrasBundle(AdMobAdapter.class, extras).build();
```

<br />

## Content URL

To provide a content URL for content-targeted ads and brand safety, add the
following:

### Kotlin

```kotlin
val builder = AdManagerAdRequest.Builder()
builder.setContentUrl("https://www.example.com")
val request = builder.build()
```

### Java

```java
AdManagerAdRequest.Builder builder = new AdManagerAdRequest.Builder();
builder.setContentUrl("https://www.example.com");
AdManagerAdRequest request = builder.build();
```

<br />

## Brand safety (Beta)

> [!NOTE]
> **Note:** Multi-content URL is in a closed beta for a select group of publishers.

Applications that display dynamic content intended for varying audiences are
able to provide a short list of URLs:

### Kotlin

```kotlin
val urls =
  mutableListOf(
    "https://www.mycontenturl1.com",
    "https://www.mycontenturl2.com",
    "https://www.mycontenturl3.com",
    "https://www.mycontenturl4.com",
  )

val requestWithContent = AdManagerAdRequest.Builder().setNeighboringContentUrls(urls).build()
```

### Java

```java
List<String> urls =
    Arrays.asList(
        "https://www.mycontenturl1.com",
        "https://www.mycontenturl2.com",
        "https://www.mycontenturl3.com",
        "https://www.mycontenturl4.com");

AdManagerAdRequest requestWithContent =
    new AdManagerAdRequest.Builder().setNeighboringContentUrls(urls).build();
```

<br />

`.setNeighboringContentUrls()` differs from `.setContentUrl()` in that it's only
used for brand safety.

> [!NOTE]
> **Note:** `setNeighboringContentUrls` only uses the first four URLs in the list. The others are ignored.