<br />

This guide is intended for publishers who are interested in using Google
Mobile Ads mediation with **Vpon**. It walks
through the setup of a mediation adapter to work with your current iOS app
and the configuration of additional settings.

| Vpon Resources |
|---|
| [Documentation](http://vpon-sdk.github.io/ios/mediation/admob/) |
| [SDK](http://vpon-sdk.github.io/ios/download/index.html) |
| [Adapter](http://vpon-sdk.github.io/ios/download/index.html#adapter-download) |
| [Customer support](mailto:fae@vpon.com) |

## Prerequisites

- An iOS app with Google Mobile Ads SDK integrated (If you don't
  have one, see [Set up Google Mobile Ads SDK](https://developers.google.com/admob/ios/quick-start.md.txt).)

- An AdMob account and [an ad unit configured with mediation line
  items](https://support.google.com/admob/answer/3124703).

## Helpful primers

The following Help Center articles provide background information on mediation:

- [About AdMob Mediation](https://support.google.com/admob/answer/3063564)
- [Set up AdMob Mediation](https://support.google.com/admob/answer/3124703)
- [Optimize AdMob Network](https://support.google.com/admob/answer/3534471)

## Add Vpon to your project

Integrate ads into your app the same as before. To integrate
non-interstitial ads (banner size, leaderboard size, and so on),
see [Banner Ads](https://developers.google.com/admob/ios/banner.md.txt). To integrate
interstitial ads (full-screen ads that mask all other content),
see [Interstitial Ads](https://developers.google.com/admob/ios/interstitial.md.txt).

The following steps change your ad placement into a mediation
placement that can show ads from multiple networks.

1. Download the adapter and SDK for Vpon from the
   [resources above](https://developers.google.com/admob/ios/mediation/vpon.md.txt#resources).

2. Add the downloaded network adapter/SDK in Xcode: right-click
   on your project and click **Add Files to <var class="readonly" translate="no">project</var>**.

3. Include any frameworks, compiler flags, or linker flags that Vpon
   require. There's no need to write additional code. Mediation invokes the
   Vpon adapter and SDK as necessary to create ads.

### Set up event notification

To be notified of ad lifecycle events like impressions, you can implement
a `GADBannerViewDelegate`. When using mediation, this delegate is
automatically notified of events from Vpon. For example, impressions
from any ad network are reported through the `adViewDidReceiveAd:` method of
`GADBannerViewDelegate`.

### Check the value of adNetworkClassName

You can optionally check the `adNetworkClassName` property on
`GADBannerView`, which returns the ad network class
name of the ad network that fetched the current banner once the
`adViewDidReceiveAd` callback is called:

### Swift

```swift
func adViewDidReceiveAd(_ bannerView: GADBannerView) {
  print("Banner adapter class name: \(bannerView.adNetworkClassName)")
}
```

### Objective-C

```objective-c
- (void)adViewDidReceiveAd:(GADBannerView *)bannerView {
  NSLog(@"Banner adapter class name: %@", bannerView.adNetworkClassName);
}
```

Similarly, for interstitials, check the `adNetworkClassName` property
on `GADInterstitialAd` inside `interstitialDidReceiveAd`:

### Swift

```swift
func interstitialDidReceiveAd(_ ad: GADInterstitialAd) {
  print("Interstitial adapter class name: \(ad.adNetworkClassName)")
}
```

### Objective-C

```objective-c
- (void)interstitialDidReceiveAd:(GADInterstitialAd *)interstitial {
  NSLog(@"Interstitial adapter class name: %@", interstitial.adNetworkClassName);
}
```
For ads returned from AdMob, `adNetworkClassName` returns `GADMAdapterGoogleAdMobAds`. For ads fetched through [custom events](https://developers.google.com/admob/ios/custom-events), it returns `GADMAdapterCustomEvents`.

<br />