> For the complete documentation index, see [llms.txt](https://aatkit.gitbook.io/ios-integration/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aatkit.gitbook.io/ios-integration/ad-networks/google-mobile-ads-sdk.md).

# Google Mobile Ads SDK

#### Google App ID

* Google Mobile Ads SDK requires publishers to add their Google app ID to the Info.plist file of their Xcode projects. Please find your Google app ID within your Google account or contact our [support](mailto:support@gravite.net).
* Follow [Google documentation](https://developers.google.com/admob/ios/quick-start#update_your_infoplist) to add your Google App ID to the Info.plist file.

#### Google Partner Bidding

Google bidding is enabled by default. If you are customizing your podfile, you can add Google Partner Bidding dependency by adding the following to your podfile:

```
pod 'AATKit/AATAdMobDSPAdapter'
```

{% hint style="info" %}
`AATAdMobDSPAdapter` depends on `GraviteRTB` SDK.
{% endhint %}

#### Collapsible banners

AATKit supports Google collapsible banners — banner ads that are initially shown as a larger overlay and can be collapsed by the user to the regular banner size.

To enable collapsible banners, set the `collapsableBannerOptions` property on your banner placement instance before loading ads:

{% tabs %}
{% tab title="Swift" %}

```swift
let placement = AATSDK.createStickyBannerPlacement(name: "BannerPlacement", size: .banner320x53)
placement?.collapsableBannerOptions = AATCollapsibleBannerOptions(position: .bottom, minDelay: 30)
```

{% endtab %}

{% tab title="Objective-C" %}

```objc
id<AATStickyBannerPlacement> placement = [AATSDK createStickyBannerPlacementWithName:@"BannerPlacement" size:AATBannerSizeBanner320x53];
placement.collapsableBannerOptions = [[AATCollapsibleBannerOptions alloc] initWithPosition:AATCollapsibleBannerPositionBottom minDelay:30];
```

{% endtab %}
{% endtabs %}

[AATCollapsibleBannerOptions](https://docs.gravite.net/aatkit/ios/docs/documentation/aatkit/aatcollapsiblebanneroptions) parameters:

* **position** — where the banner is anchored: `.top` (expands downward) or `.bottom` (expands upward). Choose the value matching your banner's position in the layout. Defaults to `.top`.
* **minDelay** — optional minimum delay in seconds between collapsible banner requests, to avoid showing the expanded overlay on every banner reload. Defaults to `0`.

The property is available on all banner placement types. When using a banner cache, set it on the cache instance after creation (or via `AATBannerConfiguration`).

{% hint style="info" %}
By default, `collapsableBannerOptions` is `nil`, meaning collapsible banner support is disabled. The setting only affects ads served by Google (AdMob / Google Ad Manager); other networks in the waterfall are not affected.
{% endhint %}

#### AdMob Maximum Inline Banners Height

* You can set the maximum height for AdMob inline adaptive banners by:
  * Create an instance of [AATAdNetworksOptions](https://docs.gravite.net/aatkit/ios/docs/documentation/aatkit/aatadnetworksoptions) including your [AATAdMobOptions](https://docs.gravite.net/aatkit/ios/docs/documentation/aatkit/aatadmoboptions).
  * Provide this instance to the [AATConfiguration](https://docs.gravite.net/aatkit/ios/docs/documentation/aatkit/aatconfiguration) while initialising AATKit.
  * AATKit will automatically forward the specified options to the GMA during ad loading.

{% tabs %}
{% tab title="Swift" %}

```swift
let conf = AATConfiguration()
...
let adMobOptions = AATAdMobOptions(inlineBannerMaxHeight: 50)
conf.adNetworksOptions = AATAdNetworksOptions(adMobOptions: adMobOptions)
...
AATSDK.initAATKit(with: conf)
```

{% endtab %}

{% tab title="Objective-C" %}

```objectivec
AATConfiguration *conf = [[AATConfiguration alloc] init];
...
AATAdMobOptions *adMobOptions = [[AATAdMobOptions alloc] initWithInlineBannerMaxHeight:50];
conf.adNetworksOptions = [[AATAdNetworksOptions alloc] initWithAppNexusOptions:nil
                                                                   adMobOptions:adMobOptions
                                                                     dfpOptions:nil
                                                              graviteRTBOptions:nil
                                                               displayIOOptions:nil
                                                             metaBiddingOptions:nil];
...
[AATSDK initAATKitWith:conf];
```

{% endtab %}
{% endtabs %}

#### DFP Maximum Inline Banners Height

* You can set the maximum height for DFP inline adaptive banners by:
  * Create an instance of [AATAdNetworksOptions](https://docs.gravite.net/aatkit/ios/docs/documentation/aatkit/aatadnetworksoptions) including your [AATDFPOptions](https://docs.gravite.net/aatkit/ios/docs/documentation/aatkit/aatdfpoptions).
  * Provide this instance to the [AATConfiguration](https://docs.gravite.net/aatkit/ios/docs/documentation/aatkit/aatconfiguration) while initialising AATKit.
  * AATKit will automatically forward the specified options to the GMA during ad loading.

{% tabs %}
{% tab title="Swift" %}

```swift
let conf = AATConfiguration()
...
let dfpOptions = AATDFPOptions(inlineBannerMaxHeight: 50)
conf.adNetworksOptions = AATAdNetworksOptions(dfpOptions: dfpOptions)
...
AATSDK.initAATKit(with: conf)
```

{% endtab %}

{% tab title="Objective-C" %}

```objectivec
AATConfiguration *conf = [[AATConfiguration alloc] init];
...
AATDFPOptions *dfpOptions = [[AATDFPOptions alloc] initWithInlineBannerMaxHeight:50];
conf.adNetworksOptions = [[AATAdNetworksOptions alloc] initWithAppNexusOptions:nil
                                                                  adMobOptions:nil
                                                                    dfpOptions:dfpOptions];
...
[AATSDK initAATKitWith:conf];
```

{% endtab %}
{% endtabs %}
