RequestConfiguration.Builder

public final class RequestConfiguration.Builder


Builder for RequestConfiguration.

Summary

Public constructors

Public methods

final @NonNull RequestConfiguration

Builds the RequestConfiguration.

final @NonNull <Error class: unknown class>

Sets a maximum ad content rating.

final @NonNull RequestConfiguration.Builder

Sets the publisher privacy treatment personalization state.

final @NonNull <Error class: unknown class>

This method allows you to specify whether you would like your app to be treated as child-directed for purposes of the Children's Online Privacy Protection Act (COPPA).

final @NonNull <Error class: unknown class>

This method allows you to mark your app to receive treatment for users in the European Economic Area (EEA) under the age of consent.

final @NonNull RequestConfiguration.Builder

Sets a list of test device IDs corresponding to test devices which will always request test ads.

Public constructors

Builder

public Builder()

Public methods

build

public final @NonNull RequestConfiguration build()

Builds the RequestConfiguration.

setMaxAdContentRating

@CanIgnoreReturnValue
public final @NonNull <Error class: unknown class> setMaxAdContentRating(
    @NonNull RequestConfiguration.MaxAdContentRating maxAdContentRating
)

Sets a maximum ad content rating. AdMob ads returned for your app will have a content rating at or below that level. Valid values are MaxAdContentRating.MAX_AD_CONTENT_RATING_G, MaxAdContentRating.MAX_AD_CONTENT_RATING_PG, MaxAdContentRating.MAX_AD_CONTENT_RATING_T, and MaxAdContentRating.MAX_AD_CONTENT_RATING_MA.

setPublisherPrivacyPersonalizationState

public final @NonNull RequestConfiguration.Builder setPublisherPrivacyPersonalizationState(
    @NonNull RequestConfiguration.PublisherPrivacyPersonalizationState publisherPrivacyPersonalizationState
)

Sets the publisher privacy treatment personalization state.

setTagForChildDirectedTreatment

@CanIgnoreReturnValue
public final @NonNull <Error class: unknown class> setTagForChildDirectedTreatment(
    @NonNull RequestConfiguration.TagForChildDirectedTreatment tagForChildDirectedTreatment
)

This method allows you to specify whether you would like your app to be treated as child-directed for purposes of the Children's Online Privacy Protection Act (COPPA).

If you set this method to TagForChildDirectedTreatment.TAG_FOR_CHILD_DIRECTED_TREATMENT_TRUE, you will indicate that your app should be treated as child-directed for purposes of the Children's Online Privacy Protection Act (COPPA).

If you set this method to TagForChildDirectedTreatment.TAG_FOR_CHILD_DIRECTED_TREATMENT_FALSE, you will indicate that your app should not be treated as child-directed for purposes of the Children's Online Privacy Protection Act (COPPA).

If you do not set this method, or set this method to TagForChildDirectedTreatment.TAG_FOR_CHILD_DIRECTED_TREATMENT_UNSPECIFIED ad requests will include no indication of how you would like your app treated with respect to COPPA.

By setting this method, 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.

Parameters
@NonNull RequestConfiguration.TagForChildDirectedTreatment tagForChildDirectedTreatment

Set to true to indicate that your app should be treated as child-directed. Set to false to indicate that your app should not be treated as child-directed.

setTagForUnderAgeOfConsent

@CanIgnoreReturnValue
public final @NonNull <Error class: unknown class> setTagForUnderAgeOfConsent(
    @NonNull RequestConfiguration.TagForUnderAgeOfConsent tagForUnderAgeOfConsent
)

This method allows you to mark your app 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) . Note that you may have other legal obligations under GDPR. Please review the European Union's guidance and consult with your own legal counsel. Please remember that Google's tools are designed to facilitate compliance and do not relieve any particular publisher of its obligations under the law.

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

If you set this method to TagForUnderAgeOfConsent.TAG_FOR_UNDER_AGE_OF_CONSENT_TRUE, you will indicate that you want your app to be handled in a manner suitable for users under the age of consent.

If you set this method to TagForUnderAgeOfConsent.TAG_FOR_UNDER_AGE_OF_CONSENT_FALSE, you will indicate that you don't want your app to be handled in a manner suitable for users under the age of consent.

If you do not set this method, or set this method to TagForUnderAgeOfConsent.TAG_FOR_UNDER_AGE_OF_CONSENT_UNSPECIFIED, your app will include no indication of how you would like your app to be handled in a manner suitable for users under the age of consent.

setTestDeviceIds

@CanIgnoreReturnValue
public final @NonNull RequestConfiguration.Builder setTestDeviceIds(@NonNull List<@NonNull String> testDeviceIds)

Sets a list of test device IDs corresponding to test devices which will always request test ads. The test device ID for the current device is logged in logcat when the first ad request is made.

Parameters
@NonNull List<@NonNull String> testDeviceIds

the list of test devices IDs. Pass an empty list to clear the list.