This guide shows you how to use the Google Mobile Ads SDK to load and display ads from InMobi using mediation, covering both waterfall and bidding integrations. It covers how to add InMobi to an ad unit's mediation configuration, and how to integrate the InMobi SDK and adapter into a Unity app.
Supported integrations and ad formats
Integration | |
---|---|
Bidding | 1 |
Waterfall | |
Formats | |
Banner | |
Interstitial | |
Rewarded |
1 Bidding integration is in closed beta, reach out to your account manager to request access.
Requirements
- Latest Google Mobile Ads SDK
- Unity 4 or higher
- To deploy on Android
- Android API level 21 or higher
- To deploy on iOS
- iOS deployment target of 10.0 or higher
- A working Unity project configured with Google Mobile Ads SDK. See Get Started for details.
- Complete the mediation Get started guide
Step 1: Set up configurations in InMobi UI
Зарегистрируйте учетную запись InMobi.
Торги
Выберите «Использовать InMobi SSP с Google Open Bidding» и введите свой идентификатор издателя Google .
Водопад
Для водопадной интеграции не требуется никаких дополнительных действий.
Войдите в свою учетную запись InMobi после проверки.
Добавить приложение
Чтобы добавить свое приложение на панель управления InMobi, нажмите «Инвентарь» > «Настройки инвентаря» .
Нажмите «Добавить инвентарь» и выберите канал мобильного приложения в раскрывающемся меню.
Начните вводить URL-адрес опубликованного магазина приложений в строке поиска и выберите приложение из автоматически заполненных результатов. Нажмите Продолжить .
Если ваше приложение не опубликовано, нажмите «Связать вручную» и введите необходимые данные. Нажмите Продолжить .
Проверьте настройки соответствия приложений и веб-сайтов , а затем нажмите «Сохранить и создать места размещения» .
Размещения
После того как вы настроите свой инвентарь, система перенаправит вас к рабочему процессу создания места размещения.
Торги
Выберите тип рекламного блока. Введите название места размещения , выберите «Вкл» и «Google Open Bidding» для ставок по аудиториям и «Партнер» соответственно и заполните оставшуюся часть формы. Когда закончите, нажмите «Создать место размещения» .
Водопад
Выберите тип рекламного блока. Затем введите название места размещения , выберите «Выкл. для назначения ставок по аудитории » и заполните оставшуюся часть формы. Когда закончите, нажмите «Создать место размещения» .
После создания места размещения отображаются его сведения. Запишите идентификатор места размещения, который будет использоваться для настройки рекламного блокаAdMob .
Идентификатор аккаунта
Идентификатор вашей учетной записи InMobi доступен в разделе «Финансы» > «Настройки платежей» > «Информация о платеже» .
Найдите ключ API отчетов InMobi
Торги
Этот шаг не требуется для интеграции ставок.
Водопад
Откройте «Моя учетная запись» > «Настройки учетной записи» . Перейдите на вкладку «Ключ API» и нажмите «Создать ключ API» .
Выберите адрес электронной почты пользователя, для которого требуется ключ, и нажмите «Создать ключ API» . Будет создан файл, содержащий ключ API и имя пользователя/имя для входа.
Только администратор учетной записи издателя сможет сгенерировать ключ API для всех пользователей. Если вы забыли ранее сгенерированный ключ API, сбросьте ключ API, наведя курсор на свою почту на вкладке «Ключ API» .
Включите тестовый режим
Включите тестовый режим для вашего места размещения на всех показах в реальном времени или только на определенных тестовых устройствах.
Step 2: Set up InMobi demand in AdMob UI
Настройте параметры медиации для своего рекламного блока
Андроид
Инструкции см. в шаге 2 руководства дляAndroid .
iOS
Инструкции см. в шаге 2 руководства дляiOS .
Add InMobi to GDPR and US state regulations ad partners list
Выполните действия, описанные вНастройки GDPRиНастройки правил штата США, чтобы добавить InMobi в список рекламных партнеров GDPR и правил штата США. в пользовательском интерфейсе AdMob .
Step 3: Import the InMobi SDK and adapter
Download the latest version of Google Mobile Ads mediation plugin for InMobi
from the download link in the
Changelog 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.
Then, select Assets > Play Services Resolver > Android Resolver > Force
Resolve. The Unity Play Services Resolver library will perform dependency
resolution from scratch and copy the declared dependencies into the
Assets/Plugins/Android
directory of your Unity app.
Step 4: Implement privacy settings on InMobi SDK
EU consent and GDPR
Under the Google EU User Consent Policy, you must ensure that certain disclosures are given to, and consents obtained from, users in the European Economic Area (EEA) regarding the use of device identifiers and personal data. This policy reflects the requirements of the EU ePrivacy Directive and the General Data Protection Regulation (GDPR). When seeking consent, you must identify each ad network in your mediation chain that may collect, receive, or use personal data and provide information about each network's use. Google currently is unable to pass the user's consent choice to such networks automatically.
The Google Mobile Ads mediation plugin for InMobi version 2.1.0 added the
InMobi.UpdateGDPRConsent()
method that lets you pass consent information to
InMobi. The following sample code shows how to pass consent information to the
InMobi SDK. If you choose to call this method, we recommend that you do so prior
to requesting ads with the Google Mobile Ads SDK.
using GoogleMobileAds.Api.Mediation.InMobi;
using System.Collections.Generic;
// ...
Dictionary<string, string> consentObject = new Dictionary<string, string>();
consentObject.Add("gdpr_consent_available", "true");
consentObject.Add("gdpr", "1");
InMobi.UpdateGDPRConsent(consentObject);
See InMobi's GDPR implementation details for more information about the possible keys and values that InMobi accepts in this consent object.
US states privacy laws
U.S. states privacy laws require giving users the right to opt out of the "sale" of their "personal information" (as the law defines those terms), with the opt-out offered via a prominent "Do Not Sell My Personal Information" link on the "selling" party's homepage. The U.S. states privacy laws compliance guide offers the ability to enable restricted data processing for Google ad serving, but Google is unable to apply this setting to each ad network in your mediation chain. Therefore, you must identify each ad network in your mediation chain that may participate in the sale of personal information and follow guidance from each of those networks to ensure compliance.
See InMobi's CCPA documentation for guidelines on how to enable CCPA settings for InMobi.
Step 5: Add required additional code
Android
No additional code is required InMobi integration.
iOS
SKAdNetwork integration
Follow InMobi's
documentation
to add the SKAdNetwork identifiers to your project's Info.plist
file.
Step 6: Test your implementation
Включить тестовые объявления
Убедитесь, что вы зарегистрировали свое тестовое устройство дляAdMob и включили тестовый режим в пользовательском интерфейсе InMobi .
Проверьте тестовые объявления
Чтобы убедиться, что вы получаете тестовые объявления отInMobi, включите тестирование одного источника объявлений в инспекторе объявлений, используя источники объявлений InMobi (Bidding) and InMobi (Waterfall) .
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" />
You may optionally add these permissions to the
Plugins/Android/GoogleMobileAdsInMobiMediation/AndroidManifest.xml
file.
iOS
No additional steps required for iOS integration.
Error codes
If the adapter fails to receive an ad from InMobi, publishers can check the
underlying error from the ad response using
ResponseInfo
under the
following classes:
Android
com.google.ads.mediation.inmobi.InMobiAdapter
com.google.ads.mediation.inmobi.InMobiMediationAdapter
iOS
GADMAdapterInMobi
GADMediationAdapterInMobi
Here are the codes and accompanying messages thrown by the InMobi adapter when an ad fails to load:
Android
Error code | Reason |
---|---|
0-99 | InMobi SDK Errors. See code for more details. |
100 | InMobi server parameters configured in the AdMob UI are missing/invalid. |
101 | Failed to initialize the InMobi SDK. |
102 | The requested ad size does not match an InMobi supported banner size. |
103 | Ad request is not a unified native ad request. |
104 | Attempted to request an InMobi ad without initializing the InMobi SDK. This should in theory never happen since the adapter initializes the InMobi SDK prior to requesting InMobi ads. |
105 | InMobi's ad is not yet ready to be shown. |
106 | InMobi failed to display an ad. |
107 | InMobi returned a native ad that is missing a required asset. |
108 | InMobi's native ad image assets contain a malformed URL. |
109 | The adapter failed to download InMobi's native ad image assets. |
iOS
Error code | Reason |
---|---|
101 | InMobi server parameters configured in the AdMob UI are missing/invalid. |
102 | InMobi Adapter does not support the ad format being requested. |
103 | An InMobi ad is already loaded for this network configuration. |
Other | InMobi SDK returned an error. See IMRequestStatus.h for more details. |
InMobi Unity Mediation Plugin Changelog
Version Next
- Renamed
DummyClient
toPlaceholderClient
.
Version 4.6.2
- Supports InMobi Android adapter version 10.7.4.0.
- Supports InMobi iOS adapter version 10.7.4.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 9.1.1.
Version 4.6.1
- Supports InMobi Android adapter version 10.7.4.0.
- Supports InMobi iOS adapter version 10.7.2.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 9.1.0.
Version 4.6.0
- Supports InMobi Android adapter version 10.7.3.0.
- Supports InMobi iOS adapter version 10.7.2.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 9.1.0.
Version 4.5.1
- Supports InMobi Android adapter version 10.6.7.1.
- Supports InMobi iOS adapter version 10.7.2.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 9.1.0.
Version 4.5.0
- Supports InMobi Android adapter version 10.6.7.1.
- Supports InMobi iOS adapter version 10.7.1.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 9.0.0.
Version 4.4.1
- Supports InMobi Android adapter version 10.6.2.0.
- Supports InMobi iOS adapter version 10.6.0.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 8.6.0.
Version 4.4.0
- Supports InMobi Android adapter version 10.6.0.0.
- Supports InMobi iOS adapter version 10.6.0.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 8.6.0.
Version 4.3.3
- Supports InMobi Android adapter version 10.5.8.0.
- Supports InMobi iOS adapter version 10.5.8.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 8.5.2.
Version 4.3.0
- Moved adapter content to
GoogleMobileAds/Mediation/InMobi/
. - Refactored adapter namespace to use
GoogleMobileAds.Mediation.InMobi
. - Supports InMobi Android adapter version 10.5.4.1.
- Supports InMobi iOS adapter version 10.5.4.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 8.1.0.
Version 4.2.2
- Supports InMobi Android adapter version 10.1.2.1.
- Supports InMobi iOS adapter version 10.1.2.1.
- Built and tested with the Google Mobile Ads Unity Plugin version 7.3.1.
Version 4.2.1
- Supports InMobi Android adapter version 10.1.2.0.
- Supports InMobi iOS adapter version 10.1.2.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 7.3.1.
Version 4.2.0
- Supports InMobi Android adapter version 10.1.1.0.
- Supports InMobi iOS adapter version 10.1.1.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 7.3.0.
Version 4.1.0
- Supports InMobi Android adapter version 10.0.9.0.
- Supports InMobi iOS adapter version 10.1.0.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 7.3.0.
Version 4.0.4
- Supports InMobi Android adapter version 10.0.7.0.
- Supports InMobi iOS adapter version 10.0.7.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 7.0.2.
Version 4.0.3
- Supports InMobi Android adapter version 10.0.5.0.
- Supports InMobi iOS adapter version 10.0.5.0.
- Built and tested with the Google Mobile Ads Unity Plugin version 7.0.0.
Version 4.0.2
- Supports InMobi Android adapter version 10.0.3.0.
- Supports InMobi iOS adapter version 10.0.2.1.
- Built and tested with the Google Mobile Ads Unity Plugin version 7.0.0.
Version 4.0.1
- Supports InMobi Android adapter version 10.0.3.0.
- Supports InMobi iOS adapter version 10.0.2.0.
Version 4.0.0
- Supports InMobi Android adapter version 10.0.1.0.
- Supports InMobi iOS adapter version 10.0.1.0.
Version 3.2.0
- Supports InMobi Android adapter version 9.2.0.0.
- Supports InMobi iOS adapter version 9.2.1.0.
Version 3.1.2
- Supports InMobi Android adapter version 9.1.9.0.
- Supports InMobi iOS adapter version 9.1.7.0.
Version 3.1.1
- Supports InMobi Android adapter version 9.1.1.0.
- Supports InMobi iOS adapter version 9.1.1.0.
Version 3.1.0
- Supports InMobi Android adapter version 9.1.0.0.
- Supports InMobi iOS adapter version 9.1.0.0.
Version 3.0.3
- Supports InMobi Android adapter version 9.0.7.1.
- Supports InMobi iOS adapter version 9.0.7.2.
Version 3.0.2
- Supports InMobi Android adapter version 9.0.7.0.
- Supports InMobi iOS adapter version 9.0.7.0.
Version 3.0.1
- Supports InMobi Android adapter version 9.0.6.0.
- Supports InMobi iOS adapter version 9.0.7.0.
Version 3.0.0
- Supports InMobi Android adapter version 9.0.4.0.
- Supports InMobi iOS adapter version 9.0.4.0.
Version 2.4.0
- Supports InMobi Android adapter version 7.3.0.1.
- Supports InMobi iOS adapter version 7.4.0.0.
Version 2.3.0
- Supports Android adapter version 7.2.9.0.
- Supports iOS adapter version 7.3.2.0.
Version 2.2.2
- Updated the plugin to support the new Rewarded API.
- Supports Android adapter version 7.2.7.0.
- Supports iOS adapter version 7.2.7.0.
Version 2.2.1
- Supports Android adapter version 7.2.2.0.
- Supports iOS adapter version 7.2.4.0.
Version 2.2.0
- Supports Android adapter version 7.2.1.0.
- Supports iOS adapter version 7.2.0.0.
Version 2.1.2
- Supports Android adapter version 7.1.1.1.
- Supports iOS adapter version 7.1.2.0.
Version 2.1.1
- Supports Android adapter version 7.1.1.1.
- Supports iOS adapter version 7.1.1.2.
Version 2.1.0
- Supports Android adapter version 7.1.0.0.
- Supports iOS adapter version 7.1.1.1.
- Added the
InMobi.UpdateGDPRConsent()
method.
Version 2.0.0
- Supports Android adapter version 7.0.4.0.
- Supports iOS adapter version 7.1.1.0.
Version 1.0.0
- First release!
- Supports Android adapter version 6.2.4.0.
- Supports iOS adapter version 6.2.1.0.