Integrate InMobi with mediation

本指南将向您介绍如何使用 Google 移动广告 SDK 加载和展示 使用中介功能从 InMobi 网站上投放的广告, 包括广告瀑布流和出价集成其中介绍了如何将 InMobi 添加到 广告单元的中介配置以及如何集成 InMobi SDK 和 转换为 Unity 应用。

支持的集成和广告格式

集成
出价  1
瀑布
表现形式
横幅
插页式广告
激励广告
原生  2

1 出价集成已关闭 Beta 版,请与您的客户经理联系以申请访问权限。

要求

  • 最新版 Google 移动广告 SDK
  • Unity 4 或更高版本
  • 在 Android 上部署 <ph type="x-smartling-placeholder">
      </ph>
    • Android API 级别 21 或更高级别
  • 在 iOS 上部署 <ph type="x-smartling-placeholder">
      </ph>
    • iOS 部署目标为 10.0 或更高版本
  • 使用 Google 配置的有效 Unity 项目 移动广告 SDK。请参阅 如需了解详情,请开始使用
  • 完成中介流程 入门指南

第 1 步:在 InMobi 界面中设置配置

Sign up for an InMobi account.

Bidding

Select Use InMobi SSP with Google Open Bidding and enter your Google Publisher ID.

Waterfall

No additional step is required for waterfall integrations.

Log in to your InMobi account once verified.

Add an app

To add your app to the InMobi dashboard, click Inventory > Inventory Settings.

Click Add Inventory and select the Mobile App channel from the drop-down menu.

Start typing your published app store URL in the search bar and select the app from the auto-populated results. Click Continue.

If your app in not published, click Link manually and enter the required details. Click Continue.

Review the App & Website Compliance settings and then click Save and Create Placements.

Placements

After you set up your inventory, the system redirects you to the placement creation workflow.

Bidding

Select the type of ad unit. The enter a Placement Name, select On and Google Open Bidding for Audience Bidding and Partner respectively, and fill out the rest of the form. Click Create Placement when done.

Waterfall

Select the type of ad unit. Then enter a Placement Name, select Off for Audience Bidding, and fill out the rest of the form. Click Create Placement when done.

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

Account ID

Your InMobi account ID is available under Finance > Payment Settings > Payment Information.

Locate InMobi Reporting API Key

Bidding

This step isn't required for bidding integrations.

Waterfall

Go to My Account > Account Settings. Navigate to the API Key tab and click Generate API Key.

Select the email of the user the key is required for and click Generate API Key. A file containing the API key and username/login name will be generated.

Only the publisher administrator of the account will be able to generate an API key for all users. If you have forgotten the previously generated API key, reset your API key by hovering over your mail on the API Key tab.

Turn on test mode

Enable Test Mode for your placement on all live impressions or certain test devices only.

第 2 步:在界面中设置 InMobi 需求 AdMob

Configure mediation settings for your ad unit

Android

For instructions, see step 2 in the guide for Android.

iOS

For instructions, see step 2 in the guide for iOS.

将 InMobi 添加到 GDPR 和美国州级法规广告合作伙伴列表

Follow the steps in GDPR settings and US state regulations settings to add InMobi to the GDPR and US state regulations ad partners list in the AdMob UI.

第 3 步:导入 InMobi SDK 和适配器

下载适用于 InMobi 的最新版 Google 移动广告中介插件 下载链接 更新日志和提取内容 zip 文件中的 GoogleMobileAdsInMobiMediation.unitypackage

在 Unity 项目编辑器中,选择 Assets >导入软件包 >自定义 打包,并选择您GoogleMobileAdsInMobiMediation.unitypackage 已下载。确保选择所有文件,然后点击 Import(导入)。

然后,选择素材资源 >Play 服务解析器 >Android 解析器 >强制 解决。Unity Play Services Resolver 库将执行依赖项处理, 并将声明的依赖项复制到 Assets/Plugins/Android 目录中。

第 4 步:在 InMobi SDK 上实现隐私设置

根据 Google 欧盟地区用户意见征求 政策,因此您必须确保向 Google 披露特定信息,并且 针对欧洲经济区 (EEA) 境内用户就 设备标识符和个人数据的使用。此政策反映了 欧盟《电子隐私指令》和《一般数据保护条例》的要求 条例 (GDPR)。在征求用户意见时,您必须指明每个广告联盟 可能会收集、接收或使用个人数据的中介链 提供有关每个网络使用情况的信息。Google 目前无法 自动将用户的意见选择传递给此类广告网络。

适用于 InMobi 2.1.0 版的 Google 移动广告中介插件新增了 InMobi.UpdateGDPRConsent() 方法,用于向以下对象传递意见征求信息: InMobi。以下示例代码展示了如何将意见征求信息传递给 InMobi SDK。如果您选择调用此方法,建议您 到如何使用 Google 移动广告 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);

请参阅 InMobi 的 GDPR 实施 详细信息 ,详细了解 InMobi 在 此用户意见征求对象。

美国州级隐私保护法律

美国州级隐私保护法 要求向用户提供 来退出“促销”的“个人信息”(因为法律规定 这些条款),同时在其页面上以醒目方式显示“Do Not Sell My Personal 信息”请点击“销售”链接主页。通过 美国州/省/自治区/直辖市隐私权 法律合规指南提供了一项新功能, 受限的数据处理 用于 Google 广告投放,但 Google 无法对每个广告应用此设置 您的中介链中的广告联盟。因此,您必须找出每个广告联盟 可能参与销售个人数据或 并遵循每个广告联盟提供的指导, 合规性。

请参阅 InMobi 的 CCPA 文档 ,了解如何为 InMobi 启用 CCPA 设置的准则。

第 5 步:添加所需的其他代码

Android

无需其他代码,无需集成 InMobi。

iOS

SKAdNetwork 集成

关注 InMobi's 文档 将 SKAdNetwork 标识符添加到项目的 Info.plist 文件中。

第 6 步:测试实现效果

Enable test ads

Make sure you register your test device for AdMob and enable test mode in InMobi UI.

Verify test ads

To verify that you are receiving test ads from InMobi, enable single ad source testing in ad inspector using the InMobi (Bidding) and InMobi (Waterfall) ad source(s).

可选步骤

Android

权限

为了获得最佳效果,InMobi 建议添加 对应用的 AndroidManifest.xml 文件的权限。

<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" />

您可以视需要将这些权限添加到 Plugins/Android/GoogleMobileAdsInMobiMediation/AndroidManifest.xml 文件。

iOS

无需执行 iOS 集成所需的额外步骤。

错误代码

如果适配器未能接收来自 InMobi 的广告,发布商可以检查 使用 ResponseInfo(位于 以下类:

Android

com.google.ads.mediation.inmobi.InMobiAdapter
com.google.ads.mediation.inmobi.InMobiMediationAdapter

iOS

GADMAdapterInMobi
GADMediationAdapterInMobi

以下是 InMobi 适配器在以下情况下抛出的代码和附带消息: 广告加载失败:

Android

错误代码 原因
0-99 InMobi SDK 错误。请参阅代码 了解详情。
100 界面中配置的 InMobi 服务器参数缺失/无效。 AdMob
101 无法初始化 InMobi SDK。
102 所请求的广告尺寸与 InMobi 支持的横幅广告尺寸不匹配。
103 广告请求不是统一原生广告请求。
104 尝试在未初始化 InMobi SDK 的情况下请求 InMobi 广告。这个 理论上绝不应发生,因为适配器会初始化 InMobi SDK 然后再请求 InMobi 广告。
105 InMobi 的广告还未准备好展示。
106 InMobi 无法展示广告。
107 InMobi 返回的原生广告缺少必需的素材资源。
108 InMobi 的原生广告图片素材资源包含格式错误的网址。
109 适配器未能下载 InMobi 的原生广告图片素材资源。

iOS

错误代码 原因
101 界面中配置的 InMobi 服务器参数缺失/无效。 AdMob
102 InMobi 适配器不支持所请求的广告格式。
103 已针对此广告联盟配置加载了一个 InMobi 广告。
其他 InMobi SDK 返回了错误。如需了解详情,请参阅 IMRequestStatus.h

InMobi Unity 中介插件更新日志

版本 4.6.2

版本 4.6.1

版本 4.6.0

版本 4.5.1

版本 4.5.0

版本 4.4.1

版本 4.4.0

版本 4.3.3

版本 4.3.0

版本 4.2.2

版本 4.2.1

版本 4.2.0

版本 4.1.0

版本 4.0.4

版本 4.0.3

版本 4.0.2

版本 4.0.1

版本 4.0.0

版本 3.2.0

版本 3.1.2

版本 3.1.1

版本 3.1.0

版本 3.0.3

版本 3.0.2

版本 3.0.1

版本 3.0.0

版本 2.4.0

版本 2.3.0

  • 支持 Android 适配器版本 7.2.9.0。
  • 支持 iOS 适配器版本 7.3.2.0。

版本 2.2.2

  • 更新了插件以支持新的激励广告 API。
  • 支持 Android 适配器版本 7.2.7.0。
  • 支持 iOS 适配器版本 7.2.7.0。

版本 2.2.1

  • 支持 Android 适配器版本 7.2.2.0。
  • 支持 iOS 适配器版本 7.2.4.0。

版本 2.2.0

  • 支持 Android 适配器版本 7.2.1.0。
  • 支持 iOS 适配器版本 7.2.0.0。

版本 2.1.2

  • 支持 Android 适配器版本 7.1.1.1。
  • 支持 iOS 适配器版本 7.1.2.0。

版本 2.1.1

  • 支持 Android 适配器版本 7.1.1.1。
  • 支持 iOS 适配器版本 7.1.1.2。

版本 2.1.0

  • 支持 Android 适配器版本 7.1.0.0。
  • 支持 iOS 适配器版本 7.1.1.1。
  • 添加了 InMobi.UpdateGDPRConsent() 方法。

版本 2.0.0

  • 支持 Android 适配器版本 7.0.4.0。
  • 支持 iOS 适配器版本 7.1.1.0。

版本 1.0.0

  • 第一个版本!
  • 支持 Android 适配器版本 6.2.4.0。
  • 支持 iOS 适配器版本 6.2.1.0。