Help improve AdMob developer resources. Take this short survey today!

Integrating InMobi with Mediation

This guide is intended for publishers who want to use the Google Mobile Ads SDK to load and display ads from InMobi via mediation. It covers how to add InMobi to an ad unit's mediation configuration, how to set up Ad Network Optimization (ANO), and how to integrate the InMobi SDK and adapter into a Unity app.

Supported ad formats and features

Formats
Banners
Interstitials
Rewarded video
Features
Smart banners
Ad Network Optimization (ANO)

Requirements

  • Unity 4 or higher
  • To deploy on Android
    • Android API level 15 or higher
    • Google Play services 9.0.0 or higher
  • To deploy on iOS
    • Xcode 7.0 or higher
    • iOS Deployment target of 7.0 or higher
    • Google Mobile Ads SDK 7.14.0 or higher
  • A working Unity project configured with Google Mobile Ads SDK. See the Get Started guide for details.

Step 1: Set up InMobi

First, sign up or log in to your InMobi account.

Add an app

Click the + Add an App button to add your app to InMobi. If your app supports both Android and iOS platforms, you need to add each one of them separately.

If your app is already published, enter its URL and click the Look Up button. Otherwise click Have an app that isn't yet published?

Choose your platform to view the unpublished app information screen.

Android

iOS

Enter the name of your unpublished app and choose the platform your app supports. Select whether or not your app is COPPA compliant and click Add App when done.

Create a placement

InMobi requires you to create a placement before you finish adding your app.

Banner

Select BANNER as the type and enter a Placement Name. Click the Create Placement button when done.

Once the placement is created, its details are are shown. Take note of the Placement ID, which will be used later to set up your AdMob ad unit.

Interstitial

Select INTERSTITIAL as the type and enter a Placement Name for your placement. Click the Create Placement button when done.

Once the placement is created, its details are are shown. Take note of the Placement ID, which will be used later to set up your AdMob ad unit.

Rewarded Video

Select REWARDED VIDEO as the type and enter a Placement Name for your placement. Click the Create Placement button when done.

Once the placement is created, its details are are shown. Take note of the Placement ID, which will be used later to set up your AdMob ad unit.

Enter values for Key and Value in the reward details section and click Done.

Native

Select NATIVE CONTENT as the type and enter a Placement Name for your placement. Click the Create Placement button when done.

Once the placement is created, its details are shown. Take note of the Placement ID, which will be used later to set up your AdMob ad unit. Select either TILE, STREAM or SPLASH as the Native Ad Layout style and click Customize.

The FEED native ad layout does not contain some of the assets that are required by the Google Mobile Ads SDK and the adapter will fail the ad request if one of the required assets is missing.

Select the desired Screenshots (main image) size, then click Save.

Now that the placement has been created, click Proceed to Integration, then click Done.

Next, you will get your Account ID.

Your Account ID can be located by clicking on your email address (located in the top right corner of your InMobi dashboard).

In addition to your Account ID and your Placement ID, you need a Secret Key provided by InMobi. Contact the InMobi support team to obtain your key.

For InMobi SDK versions lower than 5

If you're using a version of the InMobi SDK lower than 5.0.0, you need an App ID instead of the Account ID and Placement ID to set up AdMob ad units for InMobi mediation.

To get your App ID, Open your app's Configuration page by clicking on your app's name in the InMobi dashboard home page.

Your App ID is located under the app name at the top of the page.

Step 2: Configure AdMob ad unit

You need to add InMobi to the mediation configuration for one or more of your ad units. If you're deploying your Unity app to both Android and iOS, you need two AdMob ad units—one for each platform.

First, sign into the AdMob UI. Next, follow the instructions for either AdMob or AdMob Beta, depending on which version of the AdMob UI you're using.

AdMob Android

Navigate to the Monetize tab and select your application from the list of all your applications on the left-hand side. Click the link in the mediation column for the ad unit to which you want to add InMobi.

Click NEW AD NETWORK. A list of supported ad networks will be shown.

Select InMobi from the list of networks provided and enter the Account ID and Placement ID obtained in the previous section.

  • For InMobi SDK 5.0 and later - Use Account ID and Placement ID.

  • For InMobi SDK versions prior to 5.0 - Use App ID (leave Account ID and Placement ID blank).

Enter your Login name and Password along with the Secret key obtained from InMobi support to set up ANO for InMobi.

Click Continue at the bottom of the page to complete the addition of the network. Then, enter an eCPM value for InMobi and click Save.

AdMob iOS

Navigate to the Monetize tab and select your application from the list of all your applications on the left-hand side. Click the link in the mediation column for the ad unit to which you want to add InMobi.

Click NEW AD NETWORK. A list of supported ad networks will be shown.

Select InMobi from the list of networks provided and enter the Account ID and Placement ID obtained in the previous section.

  • For InMobi SDK 5.0 and later - Use Account ID and Placement ID.

  • For InMobi SDK versions prior to 5.0 - Use App ID (leave Account ID and Placement ID blank).

Enter your Login name and Password along with the Secret key obtained from InMobi support to set up ANO for InMobi.

Click Continue at the bottom of the page to complete the addition of the network. Then enter an eCPM value for InMobi and click Save.

AdMob Beta Android

Navigate to the Mediation tab. If you have an existing mediation group you would like to modify, click the name of that mediation group to edit it, and skip ahead to Add InMobi as an ad source.

To create a new mediation group, select Create Mediation Group.

Enter your ad format and platform, then click Continue.

Give your mediation group a name, and select locations to target. Next, set the mediation group status to Enabled.

Then click Add Ad Units.

Associate this mediation group with one or more of your existing AdMob ad units. Then click Done.

You should now see the ad units card populated with the ad units you selected, as shown below:

Add InMobi as an ad source

In the Ad Sources card, select Add Ad Network.

Select InMobi and enable the Optimize switch. Enter your Login name and Password along with the Secret key obtained in the previous section to set up ANO for InMobi. Then enter an eCPM value for InMobi and click Continue.

Enter the Account ID and the Placement ID obtained in the previous section.

  • For InMobi SDK 5.0 and later - Use Account ID and Placement ID.

  • For InMobi SDK versions prior to 5.0 - Use App ID (leave Account ID and Placement ID blank).

AdMob Beta iOS

Navigate to the Mediation tab. If you have an existing mediation group you'd like to modify, click the name of that mediation group to edit it, and skip ahead to Add InMobi as an ad source. To create a new mediation group, select Create Mediation Group.

Enter your ad format and platform, then click Continue.

Give your mediation group a name, and select locations to target.

Next, set the mediation group status to Enabled. Then click Add Ad Units.

Associate this mediation group with one or more of your existing AdMob ad units. Then click Done.

You should now see the ad units card populated with the ad units you selected as shown below:

Add InMobi as an ad source

In the Ad Sources card, select Add Ad Network.

Select InMobi and enable the Optimize switch. Enter your Login name and Password along with the Secret key obtained in the previous section to set up ANO for InMobi. Then enter an eCPM value for InMobi, check the authorization checkbox, and click Continue.

Enter the Account ID and the Placement ID obtained in the previous section.

  • For InMobi SDK 5.0 and later - Use Account ID and Placement ID.

  • For InMobi SDK versions prior to 5.0 - Use App ID (leave Account ID and Placement ID blank).

Using rewarded video ads

In the settings for your rewarded video ad unit, check the Override reward settings from third-party ad networks when using AdMob mediation so that you provide the same reward to the user no matter which ad network is served.

If you don't override the reward, the InMobi adapter passes back the reward specified in the InMobi dashboard when creating the placement.

For more information on setting reward values for AdMob ad units, see Create an ad unit.

Step 3: Import the InMobi SDK and adapter

Download the latest version of the Google Mobile Ads mediation plugin for InMobi and extract GoogleMobileAdsInMobiMediation.unitypackage from the zip file.

In your Unity project editor, select Assets > Import Package > Custom Package and select the GoogleMobileAdsInMobiMediation.unitypackage file you downloaded. Make sure that all the files are selected and click Import.

Step 4: Add required additional code

Android

Modify Android manifest

Activities

Include the following Activity tag in your AndroidManifest.xml under the application tag:

<activity
  android:name="com.inmobi.rendering.InMobiAdActivity"
  android:configChanges="keyboardHidden|orientation|keyboard|smallestScreenSize|screenSize|screenLayout"
  android:hardwareAccelerated="true"
  android:resizeableActivity="false"
  android:theme="@android:style/Theme.NoTitleBar"
  tools:ignore="UnusedAttribute" />

Other elements

Include the following Receiver tag in your AndroidManifest.xml under the application tag:

<receiver
  android:name="com.inmobi.commons.core.utilities.uid.ImIdShareBroadCastReceiver"
  android:enabled="true"
  android:exported="true"
  tools:ignore="ExportedReceiver">
    <intent-filter>
      <action android:name="com.inmobi.share.id"/>
    </intent-filter>
</receiver>

iOS

No additional code required for iOS integration.

Step 5: Test your implementation

To enable test ads for a placement, go to your app's details page by clicking on your app's name in the InMobi dashboard and navigate to the Placements tab located in the left navigation bar. Select the placement for which you want to enable test ads and click on the Diagnostics section to expand it.

Android

iOS

You can either choose Global ON or Selective ON as the Test Mode. If you selected Selective ON, you need to add a test device. Make sure that InMobi Test Ad is selected as the Test ad.

Optional steps

Android

Permissions

For optimal performance, InMobi recommends adding the following optional permissions to your app's AndroidManifest.xml file.

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />

iOS

No additional steps required for iOS integration.

Send feedback about...

Google Mobile Ads SDK for Unity
Google Mobile Ads SDK for Unity
Need help? Visit our support page.