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. 
     
    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

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. 
 

Passing user consent information 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 JSONObject representation of all kind of consent provided by the publisher to the SDK. The key is mandatory if you wish to monetize traffic from European Economic Area; InMobi relies on publishers to obtain user consent to comply with the regulations. 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 Ad tech Vendor.

The string must follow the IAB contracts as mentioned here.

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

gdpr_consent_available boolean

true: Publisher has provided consent to collect and use user’s data.

false: - Publisher has not provided consent to collect and use user’s data.

Any value other than “true” and “false” is invalid and will be treated as value not provided by publisher, i.e. empty value.

The key gdpr_consent_available can be accessed via string constant IM_GDPR_CONSENT_AVAILABLE.

gdpr String Whether or not the request is subjected to GDPR regulations, deviation from the set values (0 = No, 1 = Yes ), indicate an unknown entity.

Note

  1. You need to provide consentObject in every session. The SDK does not persist consent, it only keeps the consentObject in memory. If the app is relaunched or crashes - SDK will lose the consentObject.
  2. Within a session, you can update the consent this way:

    InMobiSdk.updateGDPRConsent(JSONObject consentObject)	
    
  3. 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.


Advanced Configurations

Pass the Location Information

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

AgeGroup.BELOW_18

AgeGroup.BETWEEN_18_AND_20

AgeGroup.BETWEEN_21_AND_24

AgeGroup.BETWEEN_25_AND_34

AgeGroup.BETWEEN_35_AND_54

AgeGroup.ABOVE_55

The age group of the user

setEducation

Education.HIGH_SCHOOL_OR_LESS

Education.COLLEGE_OR_GRADUATE

Education.POST_GRADUATE_OR_ABOVE

The education level

  • High school, or less
  • College, or graduate
  • Postgraduate, or above

setAge

Integer

The age of the user

setInterests

Any String

Any additional relevant description of the user, or their preferences, separated by commas. Valid acceptable values are mentioned below

setPostalCode

Any String

The postal code (usually a 5 digit number)

setAreaCode

Any String

The area code (part of the telephone number)

setLanguage

Any String

The native language of the user (if known)

setLocationWithCityStateCountry

Any String

Sets location with City, State, Country being passed

setKeywords

Any String

Keywords to be passed in the ad request

Here is a sample for setting up the InMobi SDK Demographic params. The publishers need to set the values of params as they want.

InMobiSdk.setAreaCode("080");
InMobiSdk.setEducation(Education.HIGH_SCHOOL_OR_LESS);
InMobiSdk.setGender(Gender.MALE);
InMobiSdk.setAge(23);
InMobiSdk.setPostalCode("122009");
InMobiSdk.setLogLevel(LogLevel.DEBUG);
InMobiSdk.setLocationWithCityStateCountry("blore", "kar", "india");
InMobiSdk.setLanguage("ENG");
InMobiSdk.setInterests("dance");
InMobiSdk.setYearOfBirth(1980);

On This Page

Last Updated on: 19 Aug, 2021