This guide is intended for publishers who are interested in serving:

  • Banner Ads
  • MRect Ads
  • Fullscreen Interstitials

from PubNative using the Admob mediation network. This document will include help the setting up of the mediation adapter with your Android application.

Requirements

  • AdMob Android SDK
  • PubNative Android iOS Adapter
  • An App Token obtained from PubNative Dashboard
  • A Placement Name configured and obtained from the PubNative Dashboard

Note: At the moment, this adapter project is supporting the versions down below:

  • Pubnative SDK: 2.0.11
  • AdMob:10.2.6
  • Android:Min API level 15

Install AdMob Android SDK

Download and install the AdMob Android SDK as described in the documentation.

Install PubNative AdMob Android Adapter

Gradle

The PubNative Admob Adapter is available via jCenter. To add the sdk dependency, open your project's build.gradle and update the repositories and dependencies blocks as follows:

repositories {
    // ... other project repositories
    jcenter()
}

// ...

dependencies {
    // ... other project dependencies
    compile 'net.pubnative:adapters.admob:10.2.6-2.0.11'
}

The adapter library includes the Pubnative Android SDK. So there's no need to import it as an extra step.

Proguard

If you are using Proguard for you Android builds then you should add the following lines to your proguard file:

-keepattributes Signature
-keep class net.pubnative.** { *; }

Adding a Custom Event of Interstitial in AdMob

  1. Sign in to your Admob account

  2. Choose an application to configure mediation

  3. Create new Ad Unit

  4. Go to Mediation section

  5. Create a new mediation or modify existing one

852
  1. Choose an Interstitial type

  2. Add new Custom Event

  3. Setup all parameters as you want at next screen, and go to next

  4. Enter class name

net.pubnative.sdk.adapters.admob.PNInterstitialAdapter
  1. In parameters add the string with app token and placement name, like this: {"app_token":<YOUR_APP_TOKEN>,"placement":<PLACEMENT_NAME>}
794

Adding a Custom Event of Banner or MRect in AdMob

  1. Sign in to your Admob account

  2. Choose an application to configure mediation

  3. Create new Ad Unit

  4. Go to Mediation section

  5. Create a new mediation or modify existing one

852
  1. Choose a Banner type

  2. Add new Custom Event

  3. Setup all parameters as you want at next screen, and go to next

  4. Enter class name

net.pubnative.sdk.adapters.admob.PNBannerAdapter
  1. In parameters add the string with app token and placement name, like this: {"app_token":<YOUR_APP_TOKEN>,"placement":<PLACEMENT_NAME>}
793