Overview

Introduction

This guide is intended for publishers who want to integrate InMobi as a demand source on third-party mediation platforms like Mopub, Google, Ironsource, Max, etc. You can integrate Banner, Interstitial, Native, and Video ad formats (supported by InMobi) on the below mediation platforms. If you instead wish to use the InMobi mediation platform, then we would recommend getting started here.


Prerequisites

Download InMobi SDK here and get started with an InMobi account here


Mediation Platforms Supported

Mediation Platform Integration Documentation
MoPub (SDK 5.16.0) iOS | Android
Google AdMob iOS | Android
ironSource Visit
Applovin/Max Visit
Appodeal Visit
Fyber Visit


Unity Plugin 

Mediation Platform Integration Documentation
MoPub Visit
Google AdMob Visit

Note

You are required to use the MediaView asset instead of the ImageView asset if you want to include a main image asset in the layout for your native ad.

We would highly recommend following the partner integration guidelines to know more about the specific mediation partner or adding InMobi as a demand source and setting up placements for mediation.

On This Page

Last Updated on: 19 Jul, 2021

MoPub (iOS)

Introduction

InMobi is now a supported SDK network on MoPub’s mediation platform and integrating the InMobi SDK is easy. Please refer to this guide for integration instructions. 

You have access to the following ad types from InMobi via MoPub mediation: 

  • Banner 
  • Medium - Banner 
  • Full-screen (Interstitial, Full-screen Video Ads) 
  • Rewarded Video 

Before you begin setting up InMobi as a network on the MoPub dashboard, it’s important that you create an InMobi account, complete your payment information register your app and configure placements to get monetizing. You can learn more about it here. 

If you have completed the above steps, then you are all good to begin setting up InMobi as a network on MoPub. Let’s begin! 

Note

The latest version of InMobi SDK supports iOS 9 or higher. Also, this version of iOS SDK requires XCode 12 or higher.


Configure InMobi as a Network

  1. On the MoPub UI navigate to the "Networks" tab. 
     
    Graphical user interface, application

Description automatically generated 

  1. Click on "New Network". 

  1. Search for "InMobi" in the list of SDK Networks, implementation type. 
     
    Graphical user interface

Description automatically generated 

  1. Click on InMobi, choose your network settings and save. 
     
    Graphical user interface, application

Description automatically generated 

  1. Your account ID is available in your InMobi account as illustrated in the screenshot below. 
     
     

  1. Placement ID is present under the Placements section as illustrated in the screenshot below. 
     
     

  1. Enter the InMobi Account ID and the Placement ID on the App & ad unit setup of the MoPub dashboard. 
     


Add the SDK and Adapter

Integrating the InMobi SDK to your project is fairly seamless. But before we begin, let’s pause for some checks:

Important Prerequisites:

Checkpoint 1: Preparing your App for iOS 10

App Transport Security (ATS), a default setting introduced with iOS 9 that mandates apps to make network connections only over TLS version 1.2 and later. Though InMobi is committed towards the adoption of HTTPS, the current setup requires our demand partners to support this change and be 100% compliant with all the requirements of ATS.

While we work with our partners progressing towards a secure environment, to ensure ads work on iOS 9 and later versions, you need to follow these steps as a near-term fix:

Disable ATS (Recommended) - to ensure non-secure content from the partners work correctly in your updated apps. To disable ATS flag, add the following code snippet to your app's Info.plist.


 

<key>NSAppTransportSecurity</key> 
<dict> 
    <key>NSAllowsArbitraryLoads</key> 
    <true/> 
</dict>

Disable ATS with exceptions (Not Recommended) - in case you plan to migrate towards ATS compliance. You can achieve so by allowing secure content from your domains by adding them on the exception list.

<key>NSAppTransportSecurity</key> 
<dict> 
    <key>NSAllowsArbitraryLoads</key> 
    <true/> 
    <key>NSExceptionDomains</key> 
    <dict> 
        <key>example.com</key> 
        <dict> 
            <key>NSIncludesSubdomains</key> 
            <true/> 
        </dict> 
    </dict> 
</dict>

Note

Refrain from using InMobi domains and CDN in the exception list as it will result in errors during the runtime.

App Store Review

If ATS is not disabled for apps, monetization will be impacted on devices running iOS 9+. The demand ecosystem has yet to migrate to SSL enabled world, causing ads not to render. The ATS disablement will trigger additional App Store review for your app, and requires you to provide justification. A sample of justification for consideration:

For monetization must support serving ads from the advertisers that do not support secure connections.

Checkpoint 2: iOS 12 WiFi Settings

Apple has introduced privacy settings to access WiFi details from iOS 12 onwards. To boost monetization and relevant user experience we encourage sharing WiFi details for targeted advertising.

  1. Enable ‘Access WiFi Information’ on your App ID.

  2. Enable access ‘Access WiFi Information’ for your target app from XCode capabilities.

  3. Ensure WiFi Access is added to your App.entitlements file.

Add the InMobi SDK

For more information on how to integrate with the MoPub SDK and InMobi SDK, please check out MoPub’s official documentation page for InMobi here


Pass User Consent to InMobi SDK

Since MoPub-InMobi Adapters don't handle GDPR currently, we suggest you to manually pass the consent to InMobi. This is optional and applicable only if you are not relying on MoPub for acquiring consent.

What is a consentObject? - A consentObject is a dictionary representation of all kinds of consent provided by the publisher to the SDK. The key is mandatory if you wish to monetize traffic from EEA region. You can read further on GDPR regulations here.

Key Type Inference
gdpr_consent String A consent string is a series of numbers, which identifies the consent status of an Adtech Vendor.

The string must follow the IAB contracts as mentioned here.

gdpr_consent_available String "true": User has provided consent to collect and use data.

"false": User has not provided consent to collect and use data.

Any value other than “true” and “false” is invalid and will be treated as value not provided by user.

The key, gdpr_consent_available can be accessed via string constant IM_GDPR_CONSENT_IAB.

gdpr String Whether or not the request is subjected to GDPR regulations (0 = No, 1 = Yes), omission indicates Unknown.

Note 

As part of the General Data Protection Regulation (“GDPR”) publishers who collect data on their apps, are required to have a legal basis for collecting and processing the personal data of users in the European Economic Area (“EEA”). Please ensure that you obtain appropriate consent from the user before making ad requests to InMobi for Europe and indicate the same by following our recommended SDK implementation. Please do not pass any demographics information of a user; if you do not have user consent from such user in Europe.

A consentObject has to be provided in every session. SDK does not persist consent, it only keeps the consentObject in memory. If the app is relaunched, SDK will lose the consentObject. Within a session, a consentObject can be updated as below:

Objective-C

[IMSdk updateGDPRConsent:@{<Insert consentObject dictionary here>}];

Swift

IMSdk.updateGDPRConsent(<Insert consentObject dictionary here>)

 

Advanced Configurations

Providing Location and Demographics Data

Recommended

If your app collects location from the user, we recommend passing it up, as impressions with location signal have higher revenue potential. InMobi SDK will automatically pass the location signals if available in the app. If you use location in your app, but would like to disable passing location signals to InMobi, then TURN OFF the “Location Permission” for your property on the InMobi dashboard.

Otherwise, modify the Custom Event class for your ad-unit to pass on the data using the InMobi SDK API. Please see sample code for more details.

InMobi supports the following parameters:

Method Name

Value

Description

setAgeGroup:

kIMSDKAgeGroupBelow18,

kIMSDKAgeGroupBetween18And24

kIMSDKAgeGroupBetween25And29

kIMSDKAgeGroupBetween30And34

kIMSDKAgeGroupBetween35And44

kIMSDKAgeGroupBetween45And54

kIMSDKAgeGroupBetween55And65

kIMSDKAgeGroupAbove65

The age group of the user

setLocation:

CLLocation object

 

Setting up Demographic Parameters

Here is a sample for setting up the InMobi SDK Demographic params. Publishers are requested to set the values of params as they want:

[IMSDK setAgeGroup:kIMSDKAgeGroupBetween18And24];
[IMSdk setGender:kIMSDKGenderMale];

Audio Handling in WKWebView

AVAudioSession. This will help preempt any content interruptions and help address user experience issues upfront. For more information read these Apple documents: Article 1, Article 2.

On This Page

Last Updated on: 12 May, 2021

MoPub (Android)

Introduction

InMobi is now a supported SDK network on MoPub’s mediation platform and integrating the InMobi SDK is easy. Please refer to this guide for integration instructions. 

You have access to the following ad types from InMobi via MoPub mediation: 

  • Banner 
  • Medium - Banner 
  • Full-screen (Interstitial, Full-screen Video Ads) 
  • Rewarded Video 

Before you begin setting up InMobi as a network on the MoPub dashboard, it’s important that you create an InMobi account, complete your payment information register your app and configure placements to get monetizing. You can learn more about it here. 

If you have completed the above steps, then you are all good to begin setting up InMobi as a network on MoPub. Let’s begin! 

Note

  • The latest version of InMobi SDK supports iOS 9 or higher. Also, this version of iOS SDK requires XCode 11 or higher.
  • The latest version of InMobi SDK supports Android 4.1 (API level 16) or higher.
  • If you have not integrated with MoPub before, you can refer to MoPub's documentation.


Configure InMobi as a Network

  1. On the MoPub UI navigate to the "Networks" tab.