GoogleMobileAds Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GADCustomEventNativeAd
Deprecated
Use GADMediationNativeAd and GADMediationAdapter instead.
@protocol GADCustomEventNativeAd <NSObject>
Native ad custom event protocol. Your native ad custom event handler class must conform to this
protocol.
-
Deprecated
Use GADMediationNativeAd and GADMediationAdapter instead.
Delegate object used for receiving custom native ad load request progress.
-
Deprecated
Use GADMediationNativeAd and GADMediationAdapter instead.
Returns an initialized custom event native ad.
Declaration
Objective-C
- (nonnull instancetype)init;
-
Deprecated
Use GADMediationNativeAd and GADMediationAdapter instead.
Called when the custom event is scheduled to be executed.
Declaration
Swift
func request(withParameter serverParameter: String, request: CustomEventRequest, adTypes: [Any], options: [Any], rootViewController: UIViewController)
Objective-C
- (void)requestNativeAdWithParameter:(nonnull NSString *)serverParameter
request:(nonnull GADCustomEventRequest *)request
adTypes:(nonnull NSArray *)adTypes
options:(nonnull NSArray *)options
rootViewController:
(nonnull UIViewController *)rootViewController;
Parameters
serverParameter
|
A value configured in the mediation UI for the custom event.
|
request
|
Ad targeting information.
|
adTypes
|
List of requested native ad types. See GADAdLoaderAdTypes.h for available ad
types.
|
options
|
Additional options configured by the publisher for requesting a native ad. See
GADNativeAdImageAdLoaderOptions.h for available image options.
|
rootViewController
|
Publisher-provided view controller.
|
-
Deprecated
Use GADMediationNativeAd and GADMediationAdapter instead.
Indicates whether the custom event handles user clicks. Return YES if the custom event should
handle user clicks. In this case, the Google Mobile Ads SDK doesn’t track user clicks and the
custom event must notify the Google Mobile Ads SDK of clicks using
+[GADMediatedNativeAdNotificationSource mediatedNativeAdDidRecordClick:]. Return NO if the
custom event doesn’t handles user clicks. In this case, the Google Mobile Ads SDK tracks user
clicks itself and the custom event is notified of user clicks through
-[GADMediatedUnifiedNativeAd didRecordClickOnAssetWithName:view:viewController:].
Declaration
Swift
func handlesUserClicks() -> Bool
Objective-C
- (BOOL)handlesUserClicks;
-
Deprecated
Use GADMediationNativeAd and GADMediationAdapter instead.
Indicates whether the custom event handles user impressions tracking. If this method returns
YES, the Google Mobile Ads SDK will not track user impressions and the custom event must notify
the Google Mobile Ads SDK of impressions using +[GADMediatedNativeAdNotificationSource
mediatedNativeAdDidRecordImpression:]. If this method returns NO, the Google Mobile Ads SDK
tracks user impressions and notifies the custom event of impressions using
-[GADMediatedUnifiedNativeAd didRecordImpression].
Declaration
Swift
func handlesUserImpressions() -> Bool
Objective-C
- (BOOL)handlesUserImpressions;
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\u003eGADCustomEventNativeAd\u003c/code\u003e is deprecated; use \u003ccode\u003eGADMediationNativeAd\u003c/code\u003e and \u003ccode\u003eGADMediationAdapter\u003c/code\u003e for native ad mediation.\u003c/p\u003e\n"],["\u003cp\u003eCustom event native ad handlers should conform to the \u003ccode\u003eGADCustomEventNativeAd\u003c/code\u003e protocol, which manages ad requests and interactions.\u003c/p\u003e\n"],["\u003cp\u003eThis protocol includes methods for requesting ads, handling user clicks and impressions, and communicating with the Google Mobile Ads SDK.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers should transition away from this deprecated protocol and adopt the recommended \u003ccode\u003eGADMediationNativeAd\u003c/code\u003e and \u003ccode\u003eGADMediationAdapter\u003c/code\u003e for future native ad implementations.\u003c/p\u003e\n"]]],["The `GADCustomEventNativeAd` protocol is deprecated; use `GADMediationNativeAd` and `GADMediationAdapter` instead. This protocol defined methods for custom native ad handling, including `requestNativeAdWithParameter:request:adTypes:options:rootViewController:` to initiate ad requests with parameters, targeting info, ad types, and options. Methods `handlesUserClicks` and `handlesUserImpressions` controlled whether the custom event or the SDK tracks clicks and impressions, respectively. This also includes a `delegate` to receive ad request progress.\n"],null,["# GoogleMobileAds Framework Reference\n\nGADCustomEventNativeAd\n======================\n\nDeprecated\n\nUse GADMediationNativeAd and GADMediationAdapter instead. \n\n @protocol GADCustomEventNativeAd \u003cNSObject\u003e\n\nNative ad custom event protocol. Your native ad custom event handler class must conform to this\nprotocol.\n- `\n ``\n ``\n `\n\n ### [delegate](#/c:objc(pl)GADCustomEventNativeAd(py)delegate)\n\n `\n ` \n Deprecated\n\n Use GADMediationNativeAd and GADMediationAdapter instead. \n Delegate object used for receiving custom native ad load request progress. \n\n #### Declaration\n\n Swift \n\n weak var delegate: (any ../Protocols/GADCustomEventNativeAdDelegate.html)? { get set }\n\n Objective-C \n\n @property (nonatomic, weak, nullable) id\u003c../Protocols/GADCustomEventNativeAdDelegate.html\u003e delegate;\n\n- `\n ``\n ``\n `\n\n ### [-init](#/c:objc(pl)GADCustomEventNativeAd(im)init)\n\n `\n ` \n Deprecated\n\n Use GADMediationNativeAd and GADMediationAdapter instead. \n Returns an initialized custom event native ad. \n\n #### Declaration\n\n Swift \n\n init()\n\n Objective-C \n\n - (nonnull instancetype)init;\n\n- `\n ``\n ``\n `\n\n ### [-requestNativeAdWithParameter:request:adTypes:options:rootViewController:](#/c:objc(pl)GADCustomEventNativeAd(im)requestNativeAdWithParameter:request:adTypes:options:rootViewController:)\n\n `\n ` \n Deprecated\n\n Use GADMediationNativeAd and GADMediationAdapter instead. \n Called when the custom event is scheduled to be executed. \n\n #### Declaration\n\n Swift \n\n func request(withParameter serverParameter: String, request: CustomEventRequest, adTypes: [Any], options: [Any], rootViewController: UIViewController)\n\n Objective-C \n\n - (void)requestNativeAdWithParameter:(nonnull NSString *)serverParameter\n request:(nonnull ../Classes/GADCustomEventRequest.html *)request\n adTypes:(nonnull NSArray *)adTypes\n options:(nonnull NSArray *)options\n rootViewController:\n (nonnull UIViewController *)rootViewController;\n\n #### Parameters\n\n |----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|\n | ` `*serverParameter*` ` | A value configured in the mediation UI for the custom event. |\n | ` `*request*` ` | Ad targeting information. |\n | ` `*adTypes*` ` | List of requested native ad types. See GADAdLoaderAdTypes.h for available ad types. |\n | ` `*options*` ` | Additional options configured by the publisher for requesting a native ad. See GADNativeAdImageAdLoaderOptions.h for available image options. |\n | ` `*rootViewController*` ` | Publisher-provided view controller. |\n\n- `\n ``\n ``\n `\n\n ### [-handlesUserClicks](#/c:objc(pl)GADCustomEventNativeAd(im)handlesUserClicks)\n\n `\n ` \n Deprecated\n\n Use GADMediationNativeAd and GADMediationAdapter instead. \n Indicates whether the custom event handles user clicks. Return YES if the custom event should\n handle user clicks. In this case, the Google Mobile Ads SDK doesn't track user clicks and the\n custom event must notify the Google Mobile Ads SDK of clicks using\n +\\[GADMediatedNativeAdNotificationSource mediatedNativeAdDidRecordClick:\\]. Return NO if the\n custom event doesn't handles user clicks. In this case, the Google Mobile Ads SDK tracks user\n clicks itself and the custom event is notified of user clicks through\n -\\[GADMediatedUnifiedNativeAd didRecordClickOnAssetWithName:view:viewController:\\]. \n\n #### Declaration\n\n Swift \n\n func handlesUserClicks() -\u003e Bool\n\n Objective-C \n\n - (BOOL)handlesUserClicks;\n\n- `\n ``\n ``\n `\n\n ### [-handlesUserImpressions](#/c:objc(pl)GADCustomEventNativeAd(im)handlesUserImpressions)\n\n `\n ` \n Deprecated\n\n Use GADMediationNativeAd and GADMediationAdapter instead. \n Indicates whether the custom event handles user impressions tracking. If this method returns\n YES, the Google Mobile Ads SDK will not track user impressions and the custom event must notify\n the Google Mobile Ads SDK of impressions using +\\[GADMediatedNativeAdNotificationSource\n mediatedNativeAdDidRecordImpression:\\]. If this method returns NO, the Google Mobile Ads SDK\n tracks user impressions and notifies the custom event of impressions using\n -\\[GADMediatedUnifiedNativeAd didRecordImpression\\]. \n\n #### Declaration\n\n Swift \n\n func handlesUserImpressions() -\u003e Bool\n\n Objective-C \n\n - (BOOL)handlesUserImpressions;"]]