Native ads are ad assets that are presented to users through UI components that
are native to the platform. They're shown using the same classes you already use
in your storyboards, and can be formatted to match your app's visual design.
When a native ad loads, your app receives an ad object that contains its assets,
and the app—rather thanGoogle Mobile Ads SDK—is then
responsible for displaying them.
Broadly speaking, there are two parts to successfully implementing native ads:
Loading an ad using the SDK and then displaying the ad content in your app.
This page shows how to use the SDK to loadnative ads.
When building and testing your apps, make sure you use test ads rather than
live, production ads.
The easiest way to load test ads is to use our dedicated test ad unit ID for
native ads on iOS:
/21775744923/example/native
It's been specially configured to return test ads for every request, and you can
use it in your own apps while coding, testing, and debugging. Just make sure you
replace it with your own ad unit ID before publishing your app.
For details onGoogle Mobile Ads SDKtest ads, seeEnable test ads.
Load ads
Native ads are loaded with theGADAdLoaderclass, which send messages to their delegates according to theGADAdLoaderDelegateprotocol.
In addition to the system-defined native format, you can also create your
owncustom native ad formatsthat can be used for direct-sold native ads. Custom native ad formats let you
pass arbitrary structured data to your app. These ads are represented by theGADCustomNativeAdclass.
Initialize the ad loader
Before you can load an ad, you have to initialize the ad loader.
The following code demonstrates how to initialize aGADAdLoader:
Swift
adLoader=AdLoader(adUnitID:"nativeAdUnitID",// The UIViewController parameter is optional.rootViewController:self,// To receive native ads, the ad loader's delegate must// conform to the NativeAdLoaderDelegate protocol.adTypes:[.native],// Use nil for default options.options:nil)// Set the delegate before making an ad request.adLoader.delegate=self
self.adLoader=[[GADAdLoaderalloc]initWithAdUnitID:"kNativeAdUnitID"// The UIViewController parameter is optional.rootViewController:self// To receive native ads, the ad loader's delegate must// conform to the NativeAdLoaderDelegate protocol.adTypes:@[GADAdLoaderAdTypeNative]// Use nil for default options.options:nil];// Set the delegate before making an ad request.self.adLoader.delegate=self;
You'll need an ad unit ID (you can use the test ID), constants to pass in theadTypesarray to specify which native formats you want to request, and any
options you want to set in theoptionsparameter. The list of possible
values for theoptionsparameter can be found in theSetting Native Ad
Options page.
TheadTypesarray should contain one or more of the following constants
:
The ad loader delegate needs to implement protocols specific to your ad type.
For native ads, theGADNativeAdLoaderDelegateprotocol includes a message
that's sent to the delegate when a native ad has loaded.
Swift
funcadLoader(_adLoader:AdLoader,didReceivenativeAd:NativeAd){// Set the delegate to receive notifications for interactions with the native ad.nativeAd.delegate=self// TODO: Display the native ad.}
-(void)adLoader:(GADAdLoader*)adLoaderdidReceiveNativeAd:(GADNativeAd*)nativeAd{// Set the delegate to receive notifications for interactions with the native ad.nativeAd.delegate=self;// TODO: Display the native ad.}
TheGADCustomNativeAdLoaderDelegateprotocol includes a message that's sent to
the delegate when a custom template ad has loaded.
Swift
funcadLoader(_adLoader:AdLoader,didReceivecustomNativeAd:CustomNativeAd){// To be notified of events related to the custom native ad interactions, set the delegate// property of the native adcustomNativeAd.delegate=self// TODO: Display the custom native ad.}
-(void)adLoader:(GADAdLoader*)adLoaderdidReceiveCustomNativeAd:(GADCustomNativeAd*)customNativeAd{// To be notified of events related to the custom native ad interactions, set the delegate// property of the native adcustomNativeAd.delegate=self;// TODO: Display the custom native ad.}
To load multiple ads in a single request, set theGADMultipleAdsAdLoaderOptionsobject when initializing aGADAdLoader.
Swift
letmultipleAdOptions=MultipleAdsAdLoaderOptions()multipleAdOptions.numberOfAds=5adLoader=AdLoader(adUnitID:"nativeAdUnitID",// The UIViewController parameter is optional.rootViewController:self,adTypes:[.native],options:[multipleAdOptions])
GADMultipleAdsAdLoaderOptions*multipleAdOptions=[[GADMultipleAdsAdLoaderOptionsalloc]init];multipleAdOptions.numberOfAds=5;self.adLoader=[[GADAdLoaderalloc]initWithAdUnitID:"kNativeAdUnitID"// The UIViewController parameter is optional.rootViewController:selfadTypes:@[GADAdLoaderAdTypeNative]options:@[multipleAdOptions]];
The number of ads per request is capped at five, and it's not guaranteed that
the SDK will return the exact number of ads requested.
Returned Google ads will all be different from each other, though ads from
reserved inventory or third-party buyers are not guaranteed to be unique.
Don't use theGADMultipleAdsAdLoaderOptionsclass if you're using mediation,
as requests for multiple native ads don't work for ad unit IDs that have been
configured for mediation.
Determine when loading has finished
After an app callsloadRequest:, it can get the results of the request using
calls to:
A request for a single ad will result in one call to one of those methods.
A request for multiple ads will result in at least one callback to the above
methods, but no more than the maximum number of ads requested.
In addition,GADAdLoaderDelegateoffers theadLoaderDidFinishLoadingcallback. This delegate method indicates that an ad loader has finished loading
ads and no other ads or errors will be reported for the request. Here's an
example of how to use it when loading several native ads at one time:
Swift
funcadLoaderDidFinishLoading(_adLoader:AdLoader){// The adLoader has finished loading ads.}
funcnativeAdDidRecordImpression(_nativeAd:NativeAd){// The native ad was shown.}funcnativeAdDidRecordClick(_nativeAd:NativeAd){// The native ad was clicked on.}funcnativeAdWillPresentScreen(_nativeAd:NativeAd){// The native ad will present a full screen view.}funcnativeAdWillDismissScreen(_nativeAd:NativeAd){// The native ad will dismiss a full screen view.}funcnativeAdDidDismissScreen(_nativeAd:NativeAd){// The native ad did dismiss a full screen view.}funcnativeAdWillLeaveApplication(_nativeAd:NativeAd){// The native ad will cause the app to become inactive and// open a new app.}
-(void)nativeAdDidRecordImpression:(GADNativeAd*)nativeAd{// The native ad was shown.}-(void)nativeAdDidRecordClick:(GADNativeAd*)nativeAd{// The native ad was clicked on.}-(void)nativeAdWillPresentScreen:(GADNativeAd*)nativeAd{// The native ad will present a full screen view.}-(void)nativeAdWillDismissScreen:(GADNativeAd*)nativeAd{// The native ad will dismiss a full screen view.}-(void)nativeAdDidDismissScreen:(GADNativeAd*)nativeAd{// The native ad did dismiss a full screen view.}-(void)nativeAdWillLeaveApplication:(GADNativeAd*)nativeAd{// The native ad will cause the app to become inactive and// open a new app.}
Apps that use native ads in a list should precache the list of ads.
When precaching ads, clear your cache and reload after one hour.
Don't callloadRequest:again on aGADAdLoaderuntil the previous request
finishes loading, as indicated byadLoaderDidFinishLoading:.
Limit native ad caching to only what is needed. For example when precaching,
only cache the ads that are immediately visible on the screen. Native ads
have a large memory footprint, and caching native ads without destroying them
results in excessive memory use.
Destroy native ads when no longer in use.
Display your ad
Once you have loaded an ad, all that remains is to display it to your users.
Head over to ourNative Advanced
guideto see how.
[[["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-12-22 UTC."],[],["Native ad implementation involves loading ads via the `GADAdLoader` class and displaying them within your app. To load ads, initialize `GADAdLoader` with an ad unit ID and specify desired ad types. Implement `GADAdLoaderDelegate` protocols to handle ad loading success or failure. Use the `loadRequest:` method to request ads and set targeting information. After loading, set the `nativeAd.delegate` and implement `GADNativeAdDelegate` to monitor ad interactions, and follow best practices such as precaching and clearing cache.\n"]]