GoogleMobileAds Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GADRequest
@interface GADRequest : NSObject <NSCopying>
Specifies optional parameters for ad requests.
-
Returns a default request.
Declaration
Objective-C
+ (nonnull instancetype)request;
-
Ad networks may have additional parameters they accept. To pass these parameters to them, create
the ad network extras object for that network, fill in the parameters, and register it here. The
ad network should have a header defining the interface for the ‘extras’ object to create. All
networks will have access to the basic settings you’ve set in this GADRequest. If you register
an extras object that is the same class as one you have registered before, the previous extras
will be overwritten.
Declaration
Swift
func register(_ extras: any AdNetworkExtras)
-
Returns the network extras defined for an ad network.
Declaration
Swift
func adNetworkExtras(for aClass: any AdNetworkExtras.Type) -> (any AdNetworkExtras)?
-
Removes the extras for an ad network. |aClass| is the class which represents that network’s
extras type.
Declaration
Swift
func removeAdNetworkExtras(for aClass: any AdNetworkExtras.Type)
-
Scene object. Used in multiscene apps to request ads of the appropriate size. If this is nil,
uses the application’s key window scene.
Declaration
Swift
weak var scene: UIWindowScene? { get set }
Objective-C
@property (nonatomic, weak, nullable) UIWindowScene *scene;
-
Array of keyword strings. Keywords are words or phrases describing the current user activity
such as @“Sports Scores” or @“Football”. Set this property to nil to clear the keywords.
Declaration
Swift
var keywords: [String]? { get set }
Objective-C
@property (nonatomic, copy, nullable) NSArray<NSString *> *keywords;
-
URL string for a webpage whose content matches the app’s primary content. This webpage content
is used for targeting and brand safety purposes.
Declaration
Swift
var contentURL: String? { get set }
Objective-C
@property (nonatomic, copy, nullable) NSString *contentURL;
-
URL strings for non-primary web content near an ad. Promotes brand safety and allows displayed
ads to have an app level rating (MA, T, PG, etc) that is more appropriate to neighboring
content.
Declaration
Swift
var neighboringContentURLs: [String]? { get set }
Objective-C
@property (nonatomic, copy, nullable) NSArray<NSString *> *neighboringContentURLStrings;
-
An identifier for a placement in reporting. A value set here will be set onto any ad returned by
this request.
Declaration
Swift
var placementID: Int64 { get set }
Objective-C
@property int64_t placementID;
-
String that identifies the ad request’s origin. Third party libraries that reference the Mobile
Ads SDK should set this property to denote the platform from which the ad request originated.
For example, a third party ad network called “CoolAds network” that is mediating requests to the
Mobile Ads SDK should set this property as “CoolAds”.
Declaration
Swift
var requestAgent: String? { get set }
Objective-C
@property (nonatomic, copy, nullable) NSString *requestAgent;
-
Key-value pairs used for custom targeting.
Declaration
Swift
var customTargeting: [String : Any]? { get set }
Objective-C
@property (nonatomic, copy, nullable) NSDictionary<NSString *, id> *customTargeting;
-
Deprecated
Use each ad format class’s loadWithAdResponseString: instead.
Deprecated. Use each ad format class’s loadWithAdResponseString: instead.
Ad string that represents an ad response. If set, the SDK will render this ad and ignore all
other targeting information set on this request.
Declaration
Swift
var adString: String? { get set }
Objective-C
@property (nonatomic, copy, nullable) NSString *adString;
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.
[null,null,["Last updated 2025-08-20 UTC."],[[["\u003cp\u003e\u003ccode\u003eGADRequest\u003c/code\u003e allows publishers to specify optional parameters for ad requests, including contextual information, targeting options, and ad network extras.\u003c/p\u003e\n"],["\u003cp\u003eYou can set keywords, content URL, and neighboring content URLs to provide contextual information about the ad request for better targeting and brand safety.\u003c/p\u003e\n"],["\u003cp\u003eAd network extras enable passing additional parameters to specific ad networks, allowing for more granular control over ad serving.\u003c/p\u003e\n"],["\u003cp\u003eCustom targeting lets you define key-value pairs to further refine the audience for your ads based on specific criteria.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003erequest\u003c/code\u003e class method returns a default \u003ccode\u003eGADRequest\u003c/code\u003e object to get started quickly.\u003c/p\u003e\n"]]],[],null,["# GoogleMobileAds Framework Reference\n\nGADRequest\n==========\n\n\n @interface GADRequest : NSObject \u003cNSCopying\u003e\n\nSpecifies optional parameters for ad requests.\n- `\n ``\n ``\n `\n\n ### [+request](#/c:objc(cs)GADRequest(cm)request)\n\n `\n ` \n Returns a default request. \n\n #### Declaration\n\n Objective-C \n\n + (nonnull instancetype)request;\n\n[Additional Parameters For Ad Networks\n-------------------------------------](#/Additional-Parameters-For-Ad-Networks)\n\n- `\n ``\n ``\n `\n\n ### [-registerAdNetworkExtras:](#/c:objc(cs)GADRequest(im)registerAdNetworkExtras:)\n\n `\n ` \n Ad networks may have additional parameters they accept. To pass these parameters to them, create\n the ad network extras object for that network, fill in the parameters, and register it here. The\n ad network should have a header defining the interface for the 'extras' object to create. All\n networks will have access to the basic settings you've set in this GADRequest. If you register\n an extras object that is the same class as one you have registered before, the previous extras\n will be overwritten. \n\n #### Declaration\n\n Swift \n\n func register(_ extras: any AdNetworkExtras)\n\n Objective-C \n\n - (void)registerAdNetworkExtras:(nonnull id\u003c../Protocols.html#/c:objc(pl)GADAdNetworkExtras\u003e)extras;\n\n- `\n ``\n ``\n `\n\n ### [-adNetworkExtrasFor:](#/c:objc(cs)GADRequest(im)adNetworkExtrasFor:)\n\n `\n ` \n Returns the network extras defined for an ad network. \n\n #### Declaration\n\n Swift \n\n func adNetworkExtras(for aClass: any AdNetworkExtras.Type) -\u003e (any AdNetworkExtras)?\n\n Objective-C \n\n - (nullable id\u003c../Protocols.html#/c:objc(pl)GADAdNetworkExtras\u003e)adNetworkExtrasFor:\n (nonnull Class\u003c../Protocols.html#/c:objc(pl)GADAdNetworkExtras\u003e)aClass;\n\n- `\n ``\n ``\n `\n\n ### [-removeAdNetworkExtrasFor:](#/c:objc(cs)GADRequest(im)removeAdNetworkExtrasFor:)\n\n `\n ` \n Removes the extras for an ad network. \\|aClass\\| is the class which represents that network's\n extras type. \n\n #### Declaration\n\n Swift \n\n func removeAdNetworkExtras(for aClass: any AdNetworkExtras.Type)\n\n Objective-C \n\n - (void)removeAdNetworkExtrasFor:(nonnull Class\u003c../Protocols.html#/c:objc(pl)GADAdNetworkExtras\u003e)aClass;\n\n[Publisher Provided\n------------------](#/Publisher-Provided)\n\n- `\n ``\n ``\n `\n\n ### [scene](#/c:objc(cs)GADRequest(py)scene)\n\n `\n ` \n Scene object. Used in multiscene apps to request ads of the appropriate size. If this is nil,\n uses the application's key window scene. \n\n #### Declaration\n\n Swift \n\n weak var scene: UIWindowScene? { get set }\n\n Objective-C \n\n @property (nonatomic, weak, nullable) UIWindowScene *scene;\n\n[Contextual Information\n----------------------](#/Contextual-Information)\n\n- `\n ``\n ``\n `\n\n ### [keywords](#/c:objc(cs)GADRequest(py)keywords)\n\n `\n ` \n Array of keyword strings. Keywords are words or phrases describing the current user activity\n such as @\"Sports Scores\" or @\"Football\". Set this property to nil to clear the keywords. \n\n #### Declaration\n\n Swift \n\n var keywords: [String]? { get set }\n\n Objective-C \n\n @property (nonatomic, copy, nullable) NSArray\u003cNSString *\u003e *keywords;\n\n- `\n ``\n ``\n `\n\n ### [contentURL](#/c:objc(cs)GADRequest(py)contentURL)\n\n `\n ` \n URL string for a webpage whose content matches the app's primary content. This webpage content\n is used for targeting and brand safety purposes. \n\n #### Declaration\n\n Swift \n\n var contentURL: String? { get set }\n\n Objective-C \n\n @property (nonatomic, copy, nullable) NSString *contentURL;\n\n- `\n ``\n ``\n `\n\n ### [neighboringContentURLStrings](#/c:objc(cs)GADRequest(py)neighboringContentURLStrings)\n\n `\n ` \n URL strings for non-primary web content near an ad. Promotes brand safety and allows displayed\n ads to have an app level rating (MA, T, PG, etc) that is more appropriate to neighboring\n content. \n\n #### Declaration\n\n Swift \n\n var neighboringContentURLs: [String]? { get set }\n\n Objective-C \n\n @property (nonatomic, copy, nullable) NSArray\u003cNSString *\u003e *neighboringContentURLStrings;\n\n- `\n ``\n ``\n `\n\n ### [placementID](#/c:objc(cs)GADRequest(py)placementID)\n\n `\n ` \n An identifier for a placement in reporting. A value set here will be set onto any ad returned by\n this request. \n\n #### Declaration\n\n Swift \n\n var placementID: Int64 { get set }\n\n Objective-C \n\n @property int64_t placementID;\n\n[Request Agent Information\n-------------------------](#/Request-Agent-Information)\n\n- `\n ``\n ``\n `\n\n ### [requestAgent](#/c:objc(cs)GADRequest(py)requestAgent)\n\n `\n ` \n String that identifies the ad request's origin. Third party libraries that reference the Mobile\n Ads SDK should set this property to denote the platform from which the ad request originated.\n For example, a third party ad network called \"CoolAds network\" that is mediating requests to the\n Mobile Ads SDK should set this property as \"CoolAds\". \n\n #### Declaration\n\n Swift \n\n var requestAgent: String? { get set }\n\n Objective-C \n\n @property (nonatomic, copy, nullable) NSString *requestAgent;\n\n[Optional Targeting Information\n------------------------------](#/Optional-Targeting-Information)\n\n- `\n ``\n ``\n `\n\n ### [customTargeting](#/c:objc(cs)GADRequest(py)customTargeting)\n\n `\n ` \n Key-value pairs used for custom targeting. \n\n #### Declaration\n\n Swift \n\n var customTargeting: [String : Any]? { get set }\n\n Objective-C \n\n @property (nonatomic, copy, nullable) NSDictionary\u003cNSString *, id\u003e *customTargeting;\n\n[AdString\n--------](#/AdString)\n\n- `\n ``\n ``\n `\n\n ### [adString](#/c:objc(cs)GADRequest(py)adString)\n\n `\n ` \n Deprecated\n\n Use each ad format class's loadWithAdResponseString: instead. \n Deprecated. Use each ad format class's loadWithAdResponseString: instead.\n\n Ad string that represents an ad response. If set, the SDK will render this ad and ignore all\n other targeting information set on this request. \n\n #### Declaration\n\n Swift \n\n var adString: String? { get set }\n\n Objective-C \n\n @property (nonatomic, copy, nullable) NSString *adString;"]]