AdMob Android Adapter

1280px-Google_AdMob_logo.svg.png

This guide is directed to Publishers interested in integrating the Start.io (Formerly StartApp) Android SDK using AdMob as the mediating network.

NOTES:
  • The code samples in this document can be copy/pasted into your source code
  • Feel free to take a look at our Sample Project to help you during the integration process.
  • If you have any questions, contact us here.

Prerequisite for adapter integration: 

AdMob is set as your mediation network

The following manual assumes you are already familiar with the AdMob Mediation Network and have already integrated the Google Mobile Ads SDK into your application with at least one Ad Unit. Otherwise, please start by reading the following articles for a walk-through explanation of what mediation is, how to use the AdMob Mediation UI, and instructions on how to add AdMob mediation code into your app.

You application is defined in your Start.io Account

At this point we assume that you have already added your application to your Start.io (Formerly StartApp) account, in case you haven't, please follow the following steps:

  1. Login into your Start.io Publisher's account
  2. Add your application and get its App ID
  3. Download the Start.io In-App SDK

For any questions or difficulties during this process, please contact us here.

You have integrated the Start.io In-App SDK V.4.6.0 and up as well as your desired Ad Formats.

Before you can integrate the mediation adapter, you need to make sure you have integrated the Start.io (Formerly StartApp) SDK V.4.6.0 or up as well as the Ad Formats you wish to monetize. 

In case you haven't, please start from the steps described on the following SDK integration guide

NOTES:
  • Note that this AdMob adapter is only comptible from Start.io (Formerly StartApp) starting from SDK V.4.6.0 and up

Step 1 - Integrating the AdMob Mediation Adapter

You can add the AdMob adapter via Maven Central dependency 

dependencies{ 
implementation 'com.startapp:inapp-sdk:4.+'
implementation 'com.startapp:admob-mediation:2.0.0'
}


Another option to integrate the Adapter is through .java files:

Start.io's AdMob Adapter is also available on Open Source from GitHub, enabling you download the Start.io Adapter.java file and debug issues in case you would like to do so. 

For this method, please download the file and add it to your project and change the package path at the top of this file (from: com.startapp.mediation.admob to your own path).

NOTES:
  • Please use only one of the options mentioned above 

Step 2 - Configure Mediation Settings

Please log in to your AdMob account in order to add Start.io (Formerly StartApp) to the mediation configuration. 

In case you have an existing mediation group to which you would like to add Start.io (Formerly StartApp) to, you can go ahead and do so. Otherwise, please follow the following steps to create a new mediation  group.

  1.  Click on the "Mediation" link on the side bar menu 

    AdMob_Mediation.png

  2. Select "CREATE MEDIATION GROUP" 

    CREATE_MEDIATION_GROUP.png

  3. Select the Ad Format you are looking to begin with and "Android as your platform"

    New_Mediation_Group_settings.png
  4. Please Name your mediation Group and Select the relevant Ad Units (existing from previous configuration in your App).

Step 3 - Add Custom Event 

In your Mediation Group go ahead to define the relevant custom event. 

Add_custom_event.png

 

Please select the Label Name as: StartApp 

Define the eCPM as expected from the Start.io Network. (note that this will impact the level of the Waterfall in which the Start.io SDK will be called)

NOTES:
  • Please note that as a custom event configured partner, AdMob will not support import of Start.io's performance data into the AdMob dashboard.
  • If you wish to export your Start.io's data via API, please contact your Start.io account manager  

Step 4 - Configure Start.io Ad Units

On the next screen: "Map ad units: StartApp" please define the following Class Name:
 com.startapp.mediation.admob.StartappAdapter

CustomEvent_Sample.png

Step 5 - AdMob Ad Unit advanced Configuration

There are several parameters for each Ad Unit which can be configured from the AdMob Portal or from the code. 

All the parameters mentioned below are optional and should be set based on your monetization strategy and criteria.

NOTES:
  • Everything defined from the AdMob Portal will override the parallel configuration made through the code.
  • All configurable parameters must be set in Json format and under the relevant custom event class, note that you can choose to configure non to any of the available parameters.

Interstitial Settings: 

Through the AdMob Portal:

{"startappAppId": "YOUR_APP_ID", "adTag":"interstitialTagFromServer", "interstitialMode":"OVERLAY", "minCPM":0.02, "muteVideo":false}  

Through the code:

final Bundle extras = new StartappAdapter.Extras.Builder()
	.setAdTag("interstitialTagFromAdRequest")
	.setInterstitialMode(StartappAdapter.Mode.OFFERWALL) // can be VIDEO and OVERLAY as well
	.muteVideo()
	.setMinCPM(0.01)
	.toBundle();
  
interstitial.loadAd(new AdRequest.Builder()
   .addCustomEventExtrasBundle(StartappAdapter.class, extras)
   .build());  

Banner Settings: 

Through the AdMob Portal:

{"startappAppId": "YOUR_APP_ID", "adTag":"bannerTagFromServer", "minCPM":0.02, "is3DBanner":false} 

Through the code:

final Bundle extras = new StartappAdapter.Extras.Builder()
	.setAdTag("bannerTagFromAdRequest")
	.enable3DBanner()
	.setMinCPM(0.01)
	.toBundle();

banner.loadAd(new AdRequest.Builder()
	.addCustomEventExtrasBundle(StartappAdapter.class, extras)
	.build()); 

Rewarded Video Settings: 

Through the AdMob Portal:

{"startappAppId": "YOUR_APP_ID", "adTag":"rewardedTagFromServer", "minCPM":0.02, "muteVideo":false} 

Through the code:

final Bundle extras = new StartappAdapter.Extras.Builder()
	.setAdTag("rewardedTagFromAdRequest")
	.muteVideo()
	.setMinCPM(0.01)
	.toBundle();

rewarded.loadAd(new AdRequest.Builder()
	.addNetworkExtrasBundle(StartappAdapter.class, extras)
	.build(), loadCallback);

Native Settings: 

Available sizes are:
SIZE72X72, SIZE100X100, SIZE150X150, SIZE340X340, SIZE1200X628, SIZE320X480, SIZE480X320

NOTES:
  • The code sample below uses a specific AdSize as a sample,  you can replace the sizes on the sample code with any of the supported AdSizes by Start.io (Formerly StartApp).

Through the AdMob Portal :

{"startappAppId": "YOUR_APP_ID", "adTag":"nativeTagFromServer", "minCPM":0.02, "nativeImageSize":"SIZE150X150", "nativeSecondaryImageSize":"SIZE340X340"}

Through the code:

final Bundle extras = new StartappAdapter.Extras.Builder()
	.setAdTag("nativeTagFromAdRequest")
	.setMinCPM(0.01)
	.setNativeImageSize(StartappAdapter.Size.SIZE72X72)
	.setNativeSecondaryImageSize(StartappAdapter.Size.SIZE150X150)
	.toBundle();

loader.loadAd(new AdRequest.Builder()
    .addCustomEventExtrasBundle(StartappAdapter.class, extras)
    .build());

 

Congratulation - that's it! You may now run your app and see Start.io (Formerly StartApp) ads in action.

Was this article helpful?
Have more questions? submit a request