java.lang.Object | |
↳ | com.google.android.gms.ads.doubleclick.PublisherAdRequest.Builder |
Builds a PublisherAdRequest
.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Sets a slot-level ad category exclusion label.
| |||||||||||
Add extra parameters to pass to a specific custom event adapter.
| |||||||||||
Adds a custom targeting parameter.
| |||||||||||
Adds a custom targeting parameter.
| |||||||||||
Add a keyword for targeting purposes.
| |||||||||||
Add extra parameters to pass to a specific ad network adapter.
| |||||||||||
Add extra parameters to pass to a specific ad network adapter.
| |||||||||||
Causes a device to receive test ads.
| |||||||||||
Constructs
PublisherAdRequest with the specified attributes. | |||||||||||
Sets the user's birthday for targeting purposes.
| |||||||||||
Sets the content URL for targeting purposes.
| |||||||||||
Sets the user's gender for targeting purposes.
| |||||||||||
This method allows apps that have opted into the Designed for
Families program to specify whether a given ad request should return Designed for
Families-compliant ads.
| |||||||||||
Sets the user's location for targeting purposes.
| |||||||||||
This method is deprecated.
Manual impressions should be enabled with
setManualImpressionsEnabled(boolean) .
| |||||||||||
Sets an identifier for use in frequency capping, audience segmentation and targeting,
sequential ad rotation, and other audience-based ad delivery controls across devices.
| |||||||||||
Sets the request agent string to identify the ad request's origin.
| |||||||||||
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.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Sets a slot-level ad category exclusion label.
Parameters | |
---|---|
categoryExclusion |
String
|
Returns | |
---|---|
PublisherAdRequest.Builder |
Add extra parameters to pass to a specific custom event adapter.
Parameters | |
---|---|
adapterClass |
Class :
The Class of the custom event adapter for which you are providing
extras. |
customEventExtras |
Bundle :
A Bundle of extra information to pass to a custom event
adapter.
|
Returns | |
---|---|
PublisherAdRequest.Builder |
Adds a custom targeting parameter. Calling this multiple times for the same key will overwrite old values.
Parameters | |
---|---|
key |
String
|
values |
List
|
Returns | |
---|---|
PublisherAdRequest.Builder |
Adds a custom targeting parameter. Calling this multiple times for the same key will overwrite old values.
Parameters | |
---|---|
key |
String
|
value |
String
|
Returns | |
---|---|
PublisherAdRequest.Builder |
Add extra parameters to pass to a specific ad network adapter. The networkExtras parameter
should be an instance of com.google.ads.mediation.NetworkExtras
, which is provided by
ad network adapters.
Note that the NetworkExtras
class has been deprecated. This method is included to
maintain compatibility with older adapters.
Parameters | |
---|---|
networkExtras |
NetworkExtras
|
Returns | |
---|---|
PublisherAdRequest.Builder |
Add extra parameters to pass to a specific ad network adapter.
Parameters | |
---|---|
adapterClass |
Class :
The Class of the adapter for the network for which you are
providing extras. |
networkExtras |
Bundle :
A Bundle of extra information to pass to a mediation adapter.
|
Returns | |
---|---|
PublisherAdRequest.Builder |
Causes a device to receive test ads. The deviceId
can be obtained by viewing the
logcat output after creating a new ad. For emulators, use DEVICE_ID_EMULATOR
.
Parameters | |
---|---|
deviceId |
String
|
Returns | |
---|---|
PublisherAdRequest.Builder |
Constructs PublisherAdRequest
with the specified attributes.
Returns | |
---|---|
PublisherAdRequest |
Sets the user's birthday for targeting purposes.
Parameters | |
---|---|
birthday |
Date
|
Returns | |
---|---|
PublisherAdRequest.Builder |
Sets the content URL for targeting purposes.
Parameters | |
---|---|
contentUrl |
String
|
Returns | |
---|---|
PublisherAdRequest.Builder |
Throws | |
---|---|
NullPointerException |
If contentUrl is {code null}. |
IllegalArgumentException |
If contentUrl is empty, or if its length exceeds 512. |
Sets the user's gender for targeting purposes. This should be GENDER_MALE
, GENDER_FEMALE
, or GENDER_UNKNOWN
.
Parameters | |
---|---|
gender |
int
|
Returns | |
---|---|
PublisherAdRequest.Builder |
This method allows apps that have opted into the Designed for Families program to specify whether a given ad request should return Designed for Families-compliant ads. Please note that the method is ONLY intended for apps that have opted into Designed for Families.
If you set this value to true
, you indicate that your app requires that the ad
request should return a Designed for Families-compliant ad.
If you set this value to false
, you indicate that your app does not require that
the ad request should return a Designed for Families-compliant ad.
Note: This setting is separate from the
Children's Online Privacy Protection Act (COPPA) "tag for child directed treatment"
setting. For COPPA-related compliance, see tagForChildDirectedTreatment(boolean)
.
Parameters | |
---|---|
isDesignedForFamilies |
boolean
|
Returns | |
---|---|
PublisherAdRequest.Builder |
Sets the user's location for targeting purposes.
Parameters | |
---|---|
location |
Location
|
Returns | |
---|---|
PublisherAdRequest.Builder |
This method is deprecated.
Manual impressions should be enabled with setManualImpressionsEnabled(boolean)
.
Enables manual impression reporting.
Parameters | |
---|---|
manualImpressionsEnabled |
boolean
|
Returns | |
---|---|
PublisherAdRequest.Builder |
Sets an identifier for use in frequency capping, audience segmentation and targeting, sequential ad rotation, and other audience-based ad delivery controls across devices.
Parameters | |
---|---|
publisherProvidedId |
String
|
Returns | |
---|---|
PublisherAdRequest.Builder |
Sets the request agent string to identify the ad request's origin. Third party libraries that reference the Mobile Ads SDK should call this method to denote the platform from which the ad request originated. For example, if a third party ad network called "CoolAds network" mediates requests to the Mobile Ads SDK, it should call this method with "CoolAds".
Parameters | |
---|---|
requestAgent |
String
|
Returns | |
---|---|
PublisherAdRequest.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.
If you set this method to 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 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, 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.
This designation will only apply to ad requests for which you have set this method.
Parameters | |
---|---|
tagForChildDirectedTreatment |
boolean :
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.
|
Returns | |
---|---|
PublisherAdRequest.Builder |