RequestConfiguration.Builder

public class RequestConfiguration.Builder


Builder for RequestConfiguration.

Summary

Public constructors

Public methods

RequestConfiguration

Builds the RequestConfiguration.

RequestConfiguration.Builder

Sets a maximum ad content rating.

RequestConfiguration.Builder

Sets the publisher privacy treatment personalization state.

RequestConfiguration.Builder

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) - http://business.ftc.gov/privacy-and-security/childrens-privacy.

RequestConfiguration.Builder

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

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 RequestConfiguration build()

Builds the RequestConfiguration.

setMaxAdContentRating

@CanIgnoreReturnValue
public RequestConfiguration.Builder setMaxAdContentRating(
    @RequestConfiguration.MaxAdContentRating @Nullable String 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 MAX_AD_CONTENT_RATING_G, MAX_AD_CONTENT_RATING_PG, MAX_AD_CONTENT_RATING_T, and MAX_AD_CONTENT_RATING_MA.

setPublisherPrivacyPersonalizationState

@CanIgnoreReturnValue
public RequestConfiguration.Builder setPublisherPrivacyPersonalizationState(
    RequestConfiguration.PublisherPrivacyPersonalizationState publisherPrivacyPersonalizationState
)

Sets the publisher privacy treatment personalization state.

setTagForChildDirectedTreatment

@CanIgnoreReturnValue
public RequestConfiguration.Builder setTagForChildDirectedTreatment(
    @RequestConfiguration.TagForChildDirectedTreatment int 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) - http://business.ftc.gov/privacy-and-security/childrens-privacy.

If you set this method to 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 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 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.

Note: it may take some time for this designation to be fully implemented in applicable Google services.

Parameters
@RequestConfiguration.TagForChildDirectedTreatment int 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 RequestConfiguration.Builder setTagForUnderAgeOfConsent(
    @RequestConfiguration.TagForUnderAgeOfConsent int 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 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 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 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 RequestConfiguration.Builder setTestDeviceIds(@Nullable List<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
@Nullable List<String> testDeviceIds

the list of test devices IDs. Pass null to clear the list.