AdMob Custom Events

Introduction

  • Requires the AATKit version 3.2 or later.

  • AATKit supports AdMob custom events for banners, fullscreen ads, rewarded videos and native ads. This allows publishers integrating AdMob to receive ads from AATKit.

How AATKit Google Mediation Adapter works:

  • Publishers must prepare their AdMob dashboard adding custom events to their mediation

  • AATKit mediation adapter implements AdMob custom events delegates

  • AATKit mediation adapter internally calls AATKit whenever GoogleMobileAds asks for an ad request (that happens when the publisher request an ad through GoogleMobileAds)

  • When AATKit responds, AATKit mediation adapter notifies the GoogleMobileAds with the request result using the AdMob custom events delegate methods

Setup

First of all, you will need to add the AATKit's repository to your repositories list. Edit your main build.gradle file:

allprojects {
    repositories {
        google()
        jcenter()
        //... other repositories you use
        maven {
            url 'https://android-sdk.aatkit.com/maven/'
        }
    }
}

Next add AATKit Google Mediation Adapter dependency to the build.gradle file. Please note the version of adapter corresponds to the used version of AATKit SDK.

dependencies {
    //... other dependencies you use
    implementation 'com.intentsoftware.addapptr:AATKitGoogleMediationAdapter:<AATKit_VERSION>'
}

Integration instructions

  1. In the AdMob dashboard, click on mediation on the left menu

  2. Create a new mediation for each ad format (Don't forget to choose the proper ad unit that you are using in your application in the GoogleMobileAds integration)

  3. Open the newly created mediation and add a custom event

  4. Edit the custom event and add the proper class name from the following:

    • Banner class name: com.intentsoftware.addapptr.aatkitgooglemediationadapter.AddapptrEventBanner

    • Interstitial class name: com.intentsoftware.addapptr.aatkitgooglemediationadapter.AddapptrEventInterstitial

    • Rewarded video class name: com.intentsoftware.addapptr.aatkitgooglemediationadapter.AddapptrEventRewarded

    • Native ads class name: com.intentsoftware.addapptr.aatkitgooglemediationadapter.AddapptrEventNativeAd

  5. Integrate with GoogleMobileAds different ad formats following their documentation

  6. Handle activity lifecycle by using AATKitAdmobAdapter public methods:

Notify about activity resume

@Override
protected void onResume() {
    super.onResume();
    AATKitAdmobAdapter.resume(this);
}

Notify about activity pause

@Override
protected void onPause() {
    AATKitAdmobAdapter.pause(this);
    super.onPause();
}

Last updated