Go to console

PublisherAdRequest.Builder

public static final class PublisherAdRequest.Builder extends Object

Builds a PublisherAdRequest.

Public Constructor Summary

Public Method Summary

PublisherAdRequest.Builder
addCategoryExclusion(String categoryExclusion)
Sets a slot-level ad category exclusion label.
PublisherAdRequest.Builder
addCustomEventExtrasBundle(Class<? extends CustomEvent> adapterClass, Bundle customEventExtras)
Add extra parameters to pass to a specific custom event adapter.
PublisherAdRequest.Builder
addCustomTargeting(String key, List<String> values)
Adds a custom targeting parameter.
PublisherAdRequest.Builder
addCustomTargeting(String key, String value)
Adds a custom targeting parameter.
PublisherAdRequest.Builder
addKeyword(String keyword)
Add a keyword for targeting purposes.
PublisherAdRequest.Builder
addNetworkExtras(NetworkExtras networkExtras)
Add extra parameters to pass to a specific ad network adapter.
PublisherAdRequest.Builder
addNetworkExtrasBundle(Class<? extends MediationExtrasReceiver> adapterClass, Bundle networkExtras)
Add extra parameters to pass to a specific ad network adapter.
PublisherAdRequest.Builder
addTestDevice(String deviceId)
Causes a device to receive test ads.
PublisherAdRequest
build()
Constructs PublisherAdRequest with the specified attributes.
PublisherAdRequest.Builder
setBirthday(Date birthday)
This method is deprecated. No replacement.
PublisherAdRequest.Builder
setContentUrl(String contentUrl)
Sets the content URL for targeting purposes.
PublisherAdRequest.Builder
setGender(int gender)
This method is deprecated. No replacement.
PublisherAdRequest.Builder
setIsDesignedForFamilies(boolean isDesignedForFamilies)
This method is deprecated. No replacement.
PublisherAdRequest.Builder
setLocation(Location location)
Sets the user's location for targeting purposes.
PublisherAdRequest.Builder
setManualImpressionsEnabled(boolean manualImpressionsEnabled)
This method is deprecated. Manual impressions should be enabled with setManualImpressionsEnabled(boolean).
PublisherAdRequest.Builder
setMaxAdContentRating(String maxAdContentRating)
This method is deprecated. See setMaxAdContentRating(String)
PublisherAdRequest.Builder
setPublisherProvidedId(String publisherProvidedId)
Sets an identifier for use in frequency capping, audience segmentation and targeting, sequential ad rotation, and other audience-based ad delivery controls across devices.
PublisherAdRequest.Builder
setRequestAgent(String requestAgent)
Sets the request agent string to identify the ad request's origin.
PublisherAdRequest.Builder
setTagForUnderAgeOfConsent(int tagForUnderAgeOfConsent)
This method is deprecated. See setTagForUnderAgeOfConsent(int)
PublisherAdRequest.Builder
tagForChildDirectedTreatment(boolean tagForChildDirectedTreatment)
This method is deprecated. See setTagForChildDirectedTreatment(int)

Inherited Method Summary

Public Constructors

public PublisherAdRequest.Builder ()

Public Methods

public PublisherAdRequest.Builder addCategoryExclusion (String categoryExclusion)

Sets a slot-level ad category exclusion label.