GoogleMobileAds Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GADRequestConfiguration
@interface GADRequestConfiguration : NSObject
Request configuration. The settings in this class will apply to all ad requests.
-
The maximum ad content rating. All Google ads will have this content rating or lower.
-
Identifiers corresponding to test devices which will always request test ads.
The test device identifier for the current device is logged to the console when the first
ad request is made.
Declaration
Swift
var testDeviceIdentifiers: [String]? { get set }
Objective-C
@property (nonatomic, copy, nullable) NSArray<NSString *> *testDeviceIdentifiers;
-
[Optional] This property indicates whether the user is under the age of consent.
https://developers.google.com/admob/ios/targeting#users_under_the_age_of_consent.
If you set this property with @YES, a TFUA parameter will be included in all ad requests, and
you are indicating that you want ad requests to be handled in a manner suitable for users under
the age of consent. 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.
If you set this property with @NO, you are indicating that you don’t want ad requests to be
handled in a manner suitable for users under the age of consent.
If you leave or reset this property as nil or unknown, ad requests will include no indication
of how you would like your ad requests to be handled in a manner suitable for users under the
age of consent.
Declaration
Swift
@NSCopying var tagForUnderAgeOfConsent: NSNumber? { get set }
Objective-C
@property (nonatomic, copy, nullable) NSNumber *tagForUnderAgeOfConsent;
-
[Optional] This property indicates whether you would like your app to be treated as
child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA),
https://www.ftc.gov/business-guidance/privacy-security/childrens-privacy.
If you set this property with @YES, you are indicating that your app should be treated as
child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA).
If you set this property with @NO, you are indicating that your app should not be treated as
child-directed for purposes of the Children’s Online Privacy Protection Act (COPPA).
If you leave or reset this property as nil or unknown, ad requests will include no indication of
how you would like your app treated with respect to COPPA.
By setting this property, 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.
Declaration
Swift
@NSCopying var tagForChildDirectedTreatment: NSNumber? { get set }
Objective-C
@property (nonatomic, copy, nullable) NSNumber *tagForChildDirectedTreatment;
-
Controls whether the Google Mobile Ads SDK publisher first-party ID, formerly known as the same
app key, is enabled. The value set persists across app sessions. The key is enabled by default.
Declaration
Swift
func setPublisherFirstPartyIDEnabled(_ enabled: Bool)
Objective-C
- (void)setPublisherFirstPartyIDEnabled:(BOOL)enabled;
-
This property lets you specify the personalization treatment that applies to subsequent ad
requests.
Declaration
Swift
var publisherPrivacyPersonalizationState: PublisherPrivacyPersonalizationState { get set }
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-20 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-20 UTC."],[[["\u003cp\u003e\u003ccode\u003eGADRequestConfiguration\u003c/code\u003e is an object used to set configurations that apply to all ad requests within your app.\u003c/p\u003e\n"],["\u003cp\u003eIt allows you to manage settings like maximum ad content rating, test device identifiers, and user consent (under-age and COPPA).\u003c/p\u003e\n"],["\u003cp\u003eYou can control personalization by enabling/disabling the publisher first-party ID or by setting the user's privacy personalization state.\u003c/p\u003e\n"],["\u003cp\u003eThis configuration helps ensure your ad requests align with privacy regulations and user preferences.\u003c/p\u003e\n"]]],["The `GADRequestConfiguration` class manages settings for all ad requests. Key actions include setting the `maxAdContentRating`, specifying `testDeviceIdentifiers` for test ads, and using `tagForUnderAgeOfConsent` and `tagForChildDirectedTreatment` to comply with user age and child-directed app regulations. It allows enabling or disabling the publisher first-party ID via `setPublisherFirstPartyIDEnabled:` and specifying personalization treatment with `publisherPrivacyPersonalizationState`. These configurations impact how ads are served and comply with privacy standards.\n"],null,["GADRequestConfiguration \n\n\n @interface GADRequestConfiguration : NSObject\n\nRequest configuration. The settings in this class will apply to all ad requests.\n- `\n ``\n ``\n `\n\n [maxAdContentRating](#/c:objc(cs)GADRequestConfiguration(py)maxAdContentRating)`\n ` \n The maximum ad content rating. All Google ads will have this content rating or lower. \n\n Declaration \n Swift \n\n var maxAdContentRating: ../Type-Definitions.html#/c:GADRequestConfiguration.h@T@GADMaxAdContentRating? { get set }\n\n Objective-C \n\n @property (nonatomic, copy, nullable) ../Type-Definitions.html#/c:GADRequestConfiguration.h@T@GADMaxAdContentRating maxAdContentRating;\n\n- `\n ``\n ``\n `\n\n [testDeviceIdentifiers](#/c:objc(cs)GADRequestConfiguration(py)testDeviceIdentifiers)`\n ` \n Identifiers corresponding to test devices which will always request test ads.\n The test device identifier for the current device is logged to the console when the first\n ad request is made. \n\n Declaration \n Swift \n\n var testDeviceIdentifiers: [String]? { get set }\n\n Objective-C \n\n @property (nonatomic, copy, nullable) NSArray\u003cNSString *\u003e *testDeviceIdentifiers;\n\n- `\n ``\n ``\n `\n\n [tagForUnderAgeOfConsent](#/c:objc(cs)GADRequestConfiguration(py)tagForUnderAgeOfConsent)`\n ` \n \\[Optional\\] This property indicates whether the user is under the age of consent.\n \u003chttps://developers.google.com/admob/ios/targeting#users_under_the_age_of_consent\u003e.\n\n If you set this property with @YES, a TFUA parameter will be included in all ad requests, and\n you are indicating that you want ad requests to be handled in a manner suitable for users under\n the age of consent. This parameter disables personalized advertising, including remarketing, for\n all ad requests. It also disables requests to third-party ad vendors, such as ad measurement\n pixels and third-party ad servers.\n\n If you set this property with @NO, you are indicating that you don't want ad requests to be\n handled in a manner suitable for users under the age of consent.\n\n If you leave or reset this property as nil or unknown, ad requests will include no indication\n of how you would like your ad requests to be handled in a manner suitable for users under the\n age of consent. \n\n Declaration \n Swift \n\n @NSCopying var tagForUnderAgeOfConsent: NSNumber? { get set }\n\n Objective-C \n\n @property (nonatomic, copy, nullable) NSNumber *tagForUnderAgeOfConsent;\n\n- `\n ``\n ``\n `\n\n [tagForChildDirectedTreatment](#/c:objc(cs)GADRequestConfiguration(py)tagForChildDirectedTreatment)`\n ` \n \\[Optional\\] This property indicates whether you would like your app to be treated as\n child-directed for purposes of the Children's Online Privacy Protection Act (COPPA),\n \u003chttps://www.ftc.gov/business-guidance/privacy-security/childrens-privacy\u003e.\n\n If you set this property with @YES, you are indicating that your app should be treated as\n child-directed for purposes of the Children's Online Privacy Protection Act (COPPA).\n\n If you set this property with @NO, you are indicating that your app should not be treated as\n child-directed for purposes of the Children's Online Privacy Protection Act (COPPA).\n\n If you leave or reset this property as nil or unknown, ad requests will include no indication of\n how you would like your app treated with respect to COPPA.\n\n By setting this property, you certify that this notification is accurate and you are authorized\n to act on behalf of the owner of the app. You understand that abuse of this setting may result\n in termination of your Google account. \n\n Declaration \n Swift \n\n @NSCopying var tagForChildDirectedTreatment: NSNumber? { get set }\n\n Objective-C \n\n @property (nonatomic, copy, nullable) NSNumber *tagForChildDirectedTreatment;\n\n- `\n ``\n ``\n `\n\n [-setPublisherFirstPartyIDEnabled:](#/c:objc(cs)GADRequestConfiguration(im)setPublisherFirstPartyIDEnabled:)`\n ` \n Controls whether the Google Mobile Ads SDK publisher first-party ID, formerly known as the same\n app key, is enabled. The value set persists across app sessions. The key is enabled by default. \n\n Declaration \n Swift \n\n func setPublisherFirstPartyIDEnabled(_ enabled: Bool)\n\n Objective-C \n\n - (void)setPublisherFirstPartyIDEnabled:(BOOL)enabled;\n\n[Publisher Privacy Treatment](#/Publisher-Privacy-Treatment)\n\n- `\n ``\n ``\n `\n\n [publisherPrivacyPersonalizationState](#/c:objc(cs)GADRequestConfiguration(py)publisherPrivacyPersonalizationState)`\n ` \n This property lets you specify the personalization treatment that applies to subsequent ad\n requests. \n\n Declaration \n Swift \n\n var publisherPrivacyPersonalizationState: PublisherPrivacyPersonalizationState { get set }\n\n Objective-C \n\n @property (nonatomic) ../Enums/GADPublisherPrivacyPersonalizationState.html publisherPrivacyPersonalizationState;"]]