With a few changes to your code, you can combine native and banner ads in your
ad requests.

## Prerequisites

- Version 7.20.0 or higher of Google Mobile Ads SDK.
- [Set up Google Mobile Ads SDK](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/quick-start.md.txt).

## Loading an ad

Custom-rendered native ads are loaded via
[`GADAdLoader`](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GADAdLoader.md.txt)
objects. The `GADAdLoader` object can also be configured to make ad requests
that can result in either a banner or native ad. Adding
`GADAdLoaderAdTypeGAMBanner` to the `adTypes` array parameter, along with
native ad types such as `GADAdLoaderAdTypeNative` when creating the
`GADAdLoader` object specifies that banner ads should compete with native ads
to fill the request.

### Swift

```swift
adLoader = GADAdLoader(adUnitID: "/21775744923/example/native-and-banner",
    rootViewController: self,
    adTypes: [.native, .gamBanner],
    options: [... ad loader options objects ...])
adLoader.delegate = self
```

### Objective-C

```objective-c
self.adLoader = [[GADAdLoader alloc]
      initWithAdUnitID:@"/21775744923/example/native-and-banner"
    rootViewController:rootViewController
               adTypes:@[ GADAdLoaderAdTypeNative, GADAdLoaderAdTypeGAMBanner ]
               options:@[ ... ad loader options objects ... ]];
self.adLoader.delegate = self;
```

> [!NOTE]
> **Note:** Banner ads can only be loaded via `GADAdLoader` objects when requested alongside native ads. To make an ad request for banners alone, follow the steps outlined in the in the [banner guide](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/banner.md.txt). In addition, banners loaded via `GADAdLoader` objects will not refresh.

## GAMBannerAdLoaderDelegate

When requesting banner ads via the `GADAdLoader`, the ad loader delegate must
conform to the `GAMBannerAdLoaderDelegate` protocol. This protocol includes a
message that's sent when a banner ad has loaded:

### Swift

```swift
public func adLoader(_ adLoader: GADAdLoader,
    didReceive GAMBannerView: GAMBannerView)
```

### Objective-C

```objective-c
- (void)adLoader:(GADAdLoader *)adLoader didReceiveGAMBannerView:(GAMBannerView *)bannerView;
```

The ad loader delegate must also specify which banner ad sizes should be
requested by responding to the `validBannerSizesForAdLoader` message as shown
below.

### Swift

```swift
public func validBannerSizes(for adLoader: GADAdLoader) -> [NSValue] {
  return [NSValueFromGADAdSize(GADAdSizeBanner),
    NSValueFromGADAdSize(GADAdSizeMediumRectangle),
    NSValueFromGADAdSize(GADAdSizeFromCGSize(CGSize(width: 120, height: 20)))]
}
```

### Objective-C

```objective-c
- (NSArray *)validBannerSizesForAdLoader:(GADAdLoader *)adLoader {
  return @[
    @(GADAdSizeBanner),
    @(GADAdSizeMediumRectangle),
    @(GADAdSizeFromCGSize(CGSizeMake(120, 20)))
  ];
}
```

> [!NOTE]
> **Note:** Don't create your own `GADAdSize` directly. Use one of the predefined ad sizes (such as `GADAdSizeBanner`), or create one using the `GADAdSizeFromCGSize` method, as shown above.

Set an ad size smaller than or equal to the device screen size.
To determine the maximum screen size on iOS 26 and later, use the
[`UIWindowScene.effectiveGeometry.coordinateSpace`](https://developer.apple.com/documentation/uikit/uiwindowscene/geometry/coordinatespace)
property. On iOS 18 and earlier, use the
[`UIWindowScene.coordinateSpace`](https://developer.apple.com/documentation/uikit/uiwindowscene/coordinatespace)
property.
For details about size constraints, see
[Troubleshoot unfilled impressions in Ad Manager](https://support.google.com/admanager/answer/1739296).


## Manual impression counting

To enable [manual impression
counting](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/banner#manual_impression_counting)
on banner ads loaded through `GADAdLoader`, set a
[`GAMBannerViewOptions`](https://developers.google.com/ad-manager/mobile-ads-sdk/ios/api/reference/Classes/GAMBannerViewOptions.md.txt)
with `enableManualImpressions` set to `YES` when initializing `GADAdLoader`.

### Swift

```swift
let bannerViewOptions = GAMBannerViewOptions()
bannerViewOptions.enableManualImpressions = true
adLoader = GADAdLoader(
  adUnitID: "/21775744923/example/native-and-banner", rootViewController: self,
  adTypes: [.native, .gamBanner], options: [bannerViewOptions])
```

### Objective-C

```objective-c
GAMBannerViewOptions *bannerViewOptions = [[GAMBannerViewOptions alloc] init];
bannerViewOptions.enableManualImpressions = YES;
self.adLoader = [[GADAdLoader alloc]
      initWithAdUnitID:@"/21775744923/example/native-and-banner"
    rootViewController:self
               adTypes:@[ GADAdLoaderAdTypeNative, GADAdLoaderAdTypeGAMBanner ]
               options:@[ bannerViewOptions ]];
```

If a banner ad loads, you can call `recordManualImpression` when you
determine that an ad has been successfully returned and is on-screen to
manually fire an impression:

### Swift

```swift
bannerView.recordImpression()
```

### Objective-C

```objective-c
[self.bannerView recordImpression];
```