將 i-mobile 與中介服務整合

This guide shows you how to use the Google Mobile Ads SDK to load and display ads from i-mobile using mediation, covering waterfall integrations. It covers how to add i-mobile to an ad unit's mediation configuration, and how to integrate the i-mobile SDK and adapter into an Android app.

The dashboard interface for i-mobile uses Japanese text for its labels, buttons, and descriptions. The screenshots in this guide have not been translated. In this guide's descriptions and instructions however, labels and buttons are translated with their English language equivalents in parentheses.

Supported integrations and ad formats

The Ad Manager mediation adapter for i-mobile has the following capabilities:

Integration
Bidding
Waterfall
Formats
Banner
Interstitial
Rewarded
Native

Requirements

  • Android API level 21 or higher

Step 1: Set up configurations in i-mobile UI

Sign up or log in to your i-mobile account.

Add your app to the i-mobile dashboard by clicking the サイト/アプリ管理 (Site/Application Management) tab and the button for your app's platform.

Fill out the form and click the 新規登録 (Sign up) button.

To create a new Advertising Spot, select your app under the サイト/アプリ管理 (Site/Application Management) tab.

Navigate to the 広告スポット管理 (Ad Spot Management) tab and click the 新規広告スポット (New Ad Spot) button.

create_ad_spot

Next, fill out the form by providing the 広告スポット名 (Ad Spot name), 広告スポットサイズ (Ad Spot size) and other details. Then, click the 新規登録 (Sign up) button.

new_ad_spot_form

Your new Ad spot is ready. To view its integration details, click the アプリ設定取得 (Get App settings) button.

ad_spot_list

Take note of the パブリッシャーID (Publisher ID), メディアID (Media ID), and スポットID (Spot ID). You'll need these parameters later when configuring i-mobile for mediation in the Ad Manager UI.

Step 2: Set up i-mobile demand in Ad Manager UI

調整廣告單元中介服務設定

登入 Ad Manager 帳戶

依序前往「廣告放送」>「收益群組」,然後按一下「新增收益群組」按鈕。

輸入收益群組的專屬「名稱」、將「狀態」設為「有效」、選取「廣告格式」,然後將「廣告空間類型」設為「行動應用程式」。接著在「指定目標」>「廣告空間」部分下,在「廣告空間」和「行動應用程式」下方,選取要新增中介服務的廣告單元。

接著,按一下「新增收益夥伴」按鈕。

如果您已經有i-mobile的收益夥伴,則可以選取。否則,請選取「建立新的收益夥伴」

選取「i-mobile」做為「廣告聯播網」,然後輸入不重複的名稱並啟用「中介服務」

開啟「自動資料收集」,然後輸入上一節中取得的Login name and API Password

選取 [收益夥伴] 後,請選擇「Mobile SDK 中介服務」做為整合類型,選擇 Android 做為平台狀態則選為「Active」。輸入上一節中取得的Publisher ID, Media ID and Spot ID 。然後輸入「預設千次曝光出價」的值。

完成後,按一下頁面下方的「儲存」

Step 3: Import the i-mobile SDK and Adapter

In your project-level settings.gradle.kts file, add the following repositories:

dependencyResolutionManagement {
  repositories {
    google()
    mavenCentral()
    maven {
      url = uri("https://imobile.github.io/adnw-sdk-android")
    }
  }
}

Then, in your app-level build.gradle.kts file, add the following implementation dependencies and configurations. Use the latest versions of the i-mobile SDK and adapter:

dependencies {
    implementation("com.google.android.gms:play-services-ads:23.0.0")
    implementation("com.google.ads.mediation:imobile:2.3.1.2")
}

Manual integration

  1. Download the latest version of the i-mobile SDK and extract the android-ad-sdk.aar under the sdk folder and add it to your project.

  2. Navigate to the i-mobile adapter artifacts on Google's Maven Repository. Select the latest version, download the i-mobile adapter's .aar file, and add it to your project.

Step 4: Add required code

No additional code is required for i-mobile integration.

Step 5: Test your implementation

啟用測試廣告

請務必為 Ad Manager。 i-mobile 提供了測試用的 Spot ID媒體 ID發布商 ID,您可以在這裡找到這些 ID。

驗證測試廣告

如要確認您正在接收來自i-mobile的測試廣告,請使用 i-mobile (Waterfall) 廣告來源在廣告檢查器中啟用單一廣告來源測試

Optional steps

Using native ads

Ad rendering

The i-mobile adapter populates the following fields for a NativeAd.

Field Assets always included by i-mobile adapter
Headline
Image
Body
App icon 1
Call to action
Star rating
Store
Price

1 For native ads, the i-mobile SDK does not provide an app icon asset. Instead, the i-mobile adapter populates the app icon with a transparent image.

Error codes

If the adapter fails to receive an ad from i-mobile, publishers can check the underlying error from the ad response using ResponseInfo.getAdapterResponse() under the following classes:

Format Class name
Banner com.google.ads.mediation.imobile.IMobileAdapter
Interstitial com.google.ads.mediation.imobile.IMobileAdapter
Native com.google.ads.mediation.imobile.IMobileMediationAdapter

Here are the codes and accompanying messages thrown by the i-mobile adapter when an ad fails to load:

Error code Reason
0-99 i-mobile SDK returned an error. See code for more details.
101 i-mobile requires an Activity context to load ads.
102 i-mobile server parameters configured in the Ad Manager UI are missing/invalid.
103 The requested ad size does not match an i-mobile supported banner size.
104 i-mobile's native ad load success callback returned an empty native ads list.

i-mobile Android Mediation Adapter Changelog

Version 2.3.1.2

  • Updated the minimum required Google Mobile Ads SDK version to 23.0.0.
  • Verified compatibility with i-mobile SDK v2.3.1.

Built and tested with:

  • Google Mobile Ads SDK version 23.0.0.
  • IMobile SDK version 2.3.1.

Version 2.3.1.1

  • Updated adapter to use new VersionInfo class.
  • Updated the minimum required Google Mobile Ads SDK version to 22.0.0.

Built and tested with:

  • Google Mobile Ads SDK version 22.0.0.
  • IMobile SDK version 2.3.1.

Version 2.3.1.0

  • Verified compatibility with i-mobile SDK v2.3.1.
  • Updated the minimum required Google Mobile Ads SDK version to 21.5.0.

Built and tested with:

  • Google Mobile Ads SDK version 21.5.0.
  • IMobile SDK version 2.3.1.

Version 2.3.0.0

  • Verified compatibility with i-mobile SDK v2.3.0.
  • Updated the minimum required Google Mobile Ads SDK version to 21.3.0.

Built and tested with:

  • Google Mobile Ads SDK version 21.3.0.
  • IMobile SDK version 2.3.0.

Version 2.0.23.1

  • Updated compileSdkVersion and targetSdkVersion to API 31.
  • Updated the minimum required Google Mobile Ads SDK version to 21.0.0.
  • Updated the minimum required Android API level to 19.

Built and tested with:

  • Google Mobile Ads SDK version 21.0.0.
  • IMobile SDK version 2.0.23.

Version 2.0.23.0

  • Verified compatibility with i-mobile SDK v2.0.23.
  • Updated the minimum required Google Mobile Ads SDK version to 20.5.0.

Built and tested with

  • Google Mobile Ads SDK version 20.5.0.
  • IMobile SDK version 2.0.23.

Version 2.0.22.2

  • Added standardized adapter error codes and messages.
  • Updated the minimum required Google Mobile Ads SDK version to 20.1.0.

Built and tested with

  • Google Mobile Ads SDK version 20.1.0.
  • IMobile SDK version 2.0.22.

Version 2.0.22.1

  • Updated the minimum required Google Mobile Ads SDK version to 20.0.0.

Built and tested with

  • Google Mobile Ads SDK version 20.0.0.
  • IMobile SDK version 2.0.22.

Version 2.0.22.0

  • Verified compatibility with i-mobile SDK v2.0.22.
  • Updated the adapter to support inline adaptive banner requests.

Built and tested with

  • Google Mobile Ads SDK version 19.1.0.
  • IMobile SDK version 2.0.22.

Version 2.0.21.0

  • Verified compatibility with i-mobile SDK v2.0.21.
  • Updated the minimum required Google Mobile Ads SDK version to 19.1.0.
  • Added support for scaling adaptive banner ads.

Built and tested with

  • Google Mobile Ads SDK version 19.1.0.
  • IMobile SDK version 2.0.21.

Version 2.0.20.2

  • Added support for flexible banner ad sizes.
  • Updated the minimum required Google Mobile Ads SDK version to 18.3.0.

Built and tested with

  • Google Mobile Ads SDK version 18.3.0.
  • IMobile SDK version 2.0.20.

Version 2.0.20.1

  • Adapter now returns a non-zero mediaContent aspect ratio.

Built and tested with

  • Google Mobile Ads SDK version 18.2.0.
  • IMobile SDK version 2.0.20.

Version 2.0.20.0

  • Initial release!
  • Added support for banner, interstitial, and native ads.