AdColony をメディエーションと統合する

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

Supported integrations and ad formats

The AdMob mediation adapter for AdColony has the following capabilities:

Integration
Bidding
Waterfall
Formats
Banner
Interstitial
Rewarded
Native

Requirements

Step 1: Set up configurations in AdColony UI

Sign up and log in to your AdColony account. Add your app to the AdColony publisher dashboard by clicking the Setup New App button.

AdColony setup new app

Fill out the form and click Create at the bottom of the page to add your app to AdColony.

AdColony create app

Once your app is created you can obtain your App ID by navigating to Monetization > Apps under your app's Basic App Information section.

AdColony app id

Next, create a new Ad Zone by clicking the Setup New Ad Zone button in the Ad Zones section of your App's page. We recommend creating a new Ad Zone for mediation with AdMob even if you already have one.

AdColony set up zone

For additional instructions on creating an ad placement, select the tab corresponding to your preferred ad format.

  1. Set Zone is Active? to Yes.
  2. Enter a Name for your Ad Zone.

  3. Choose Banner as the Ad Zone Size.

  4. Enter a value for the Daily play cap.

Interstitial

  1. Set Zone is Active? to Yes.
  2. Enter a Name for your Ad Zone.

  3. Choose Preroll/Interstitial as the Zone Type.

  4. Enter a value for the Daily play cap.

Rewarded

  1. Set Zone is Active? to Yes.
  2. Enter a Name for your Ad Zone.

  3. Choose Value Exchange/V4VC as the Zone Type.

  4. Set Client Side Only? to Yes and enter a Virtual Currency Name, Daily Max Videos per User and Reward Amount.

  5. Enter a value for the Daily play cap.

Click the Create button when finished to create the Ad Zone.

Once the Ad Zone is created, you can locate your Zone ID under the Integration section of the Ad Zone. The Zone ID will be used in the next step.

AdColony zone id

Locate your AdColony API Key

Bidding

This step isn't required for bidding integrations.

Waterfall

You will need your AdColony API Key for setting up your AdMob ad unit ID. Navigate to Account Settings in your AdColony publisher dashboard to locate your API Key.

AdColony settings

Turn on test mode

To enable test ads on AdColony, go to your AdColony dashboard and navigate to Monetization > Apps. Select your Zone for which you would like to enable test ads under the Ad Zones section of your app. Test ads can be enabled by checking Yes to Show test ads only? under the Development section.

AdColony test

Step 2: Set up AdColony demand in AdMob UI

広告ユニットのメディエーション設定を行う

広告ユニットのメディエーション設定に AdColony を追加する必要があります。

AdMob アカウントにログインします。次に、[メディエーション] タブに移動します。既存のメディエーション グループを編集する場合は、そのメディエーション グループの名前をクリックして編集し、広告ソースとして AdColony を追加するに進んでください。

新しいメディエーション グループを作成するには、[メディエーション グループを作成] を選択します。

広告フォーマットとプラットフォームを入力して、[続行] をクリックします。

メディエーション グループに名前を付けて、ターゲットとする地域を選択します。次に、メディエーション グループのステータスを [有効] に設定し、[広告ユニットを追加] をクリックします。

このメディエーション グループを、既存の 1 つ以上の広告ユニット(AdMob )に関連付けます。[完了] をクリックします。

選択した広告ユニットが入力された広告ユニットカードが表示されます。

広告ソースとして AdColony を追加

入札

[広告ソース] セクションの [入札] カードで、[広告ソースを追加] を選択します。AdColony を選択します。

[パートナー契約の署名方法] をクリックし、AdColonyとの入札パートナーシップを設定します。

[確認して同意する] をクリックし、[続行] をクリックします。

AdColonyのマッピングがすでにある場合は、それを選択できます。それ以外の場合は、[マッピングを追加] をクリックします。

次に、前のセクションで取得した App ID and Zone IDを入力します。[完了] をクリックします。

重要:AdColony UI と同様に、 App ID は対象のアプリに関連付ける必要があります。

ウォーターフォール

[広告ソース] セクションの [ウォーターフォール] カードで、[広告のソースを追加] を選択します。AdColony を選択します。

[AdColony] を選択して、[最適化] スイッチを有効にします。前のセクションで取得した API Keyを入力して、AdColonyの広告ソースの最適化を設定します。 次に、AdColony の eCPM の値を入力し、[続行] をクリックします。

AdColonyのマッピングがすでにある場合は、それを選択できます。それ以外の場合は、[マッピングを追加] をクリックします。

次に、前のセクションで取得した App ID and Zone IDを入力します。[完了] をクリックします。

Add AdColony to GDPR and US state regulations ad partners list

GDPR 設定 米国の州規制の設定 の手順に沿って、 AdMob UI の GDPR および米国の州規制の広告パートナーのリストに AdColony を追加します。

Step 3: Import the AdColony SDK and adapter

  • Add the following line to your project's Podfile:

    pod 'GoogleMobileAdsMediationAdColony'
    
  • From the command line run:

    pod install --repo-update
    

Manual integration

  • Download the latest version of the AdColony SDK, and link AdColony.framework in your project.
  • Download the latest AdColony adapter from the download link in Changelog, and link AdColonyAdapter.framework in your project.
  • Add the following libraries and frameworks to Target > Build Phases > Link Binary With Libraries:
    • libz.1.2.5.tbd
    • AdSupport
    • AudioToolbox
    • AVFoundation
    • CoreMedia
    • CoreTelephony
    • JavaScriptCore
    • MessageUI
    • MobileCoreServices
    • SystemConfiguration
    • EventKit (OPTIONAL)
    • Social (OPTIONAL)
    • StoreKit (OPTIONAL)
    • WatchConnectivity (OPTIONAL)
    • WebKit (OPTIONAL)

Step 4: Implement privacy settings on AdColony SDK

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 AdColony adapter exposes an appOptions property to customize parameters to be sent to AdColony's SDK. Two methods relevant to GDPR on these options are -setPrivacyFrameworkOfType:isRequired: and -setPrivacyConsentString:forType:. The following sample code demonstrates how to pass consent information to the AdColony adapter, which are then used in AdColony's initialization method. These options must be set before you initialize the Google Mobile Ads SDK to ensure they get forwarded properly to AdColony's SDK.

Swift

import AdColonyAdapter
//...

let appOptions = GADMediationAdapterAdColony.appOptions
appOptions?.setPrivacyFrameworkOfType(ADC_GDPR, isRequired: true)
appOptions?.setPrivacyConsentString("1", forType: ADC_GDPR)

Objective-C

#import <AdColonyAdapter/AdColonyAdapter.h>
//...

AdColonyAppOptions *options = GADMediationAdapterAdColony.appOptions;
[options setPrivacyFrameworkOfType:ADC_GDPR isRequired:YES];
[options setPrivacyConsentString:@"1" forType:ADC_GDPR];

See AdColony's GDPR implementation details for more details about what values may be provided in these methods.

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.

The AdColony adapter exposes an appOptions property to customize parameters to be sent to AdColony's SDK. Two methods relevant to CCPA on these options are -setPrivacyFrameworkOfType:isRequired: and -setPrivacyConsentString:forType:. The following sample code demonstrates how to pass consent information to the AdColony adapter, which are then used in AdColony's initialization method. These options must be set before you initialize the Google Mobile Ads SDK to ensure they get forwarded properly to AdColony's SDK.

Swift

import AdColonyAdapter
//...

let appOptions = GADMediationAdapterAdColony.appOptions
appOptions?.setPrivacyFrameworkOfType(ADC_CCPA, isRequired: true)
appOptions?.setPrivacyConsentString("1", forType: ADC_CCPA)

Objective-C

#import <AdColonyAdapter/AdColonyAdapter.h>
//...

AdColonyAppOptions *options = GADMediationAdapterAdColony.appOptions;
[options setPrivacyFrameworkOfType:ADC_CCPA isRequired:YES];
[options setPrivacyConsentString:@"1" forType:ADC_CCPA];

See AdColony's CCPA implementation details for more details about what values may be provided in these methods.

Step 5: Add required code

SKAdNetwork integration

Follow AdColony's documentation to add the SKAdNetwork identifiers to your project's Info.plist file.

Step 6: Test your implementation

テスト広告を有効にする

AdMob にテストデバイスを登録し、 AdColony UI でテストモードを有効にします。

テスト広告を確認する

AdColonyからテスト広告を受信していることを確認するには、広告インスペクタで AdColony (Bidding) and AdColony (Waterfall) 広告ソースを使用して単独の広告ソースのテストを有効にします。

Optional steps

Using interstitial and rewarded ads

The AdColony adapter supports additional request parameters which can be passed to the adapter using the GADMAdapterAdColonyExtras class. The GADMAdapterAdColonyExtras includes the following properties:

showPrePopup
Enable a reward dialog before showing the ad for a specific ad request in your app.
showPostPopup
Enable a reward dialog after showing the ad for a specific ad request in your app.

Here's a code example of how to set these parameters on the ad request:

Swift

let request = Request()
let extras = GADMAdapterAdColonyExtras()
extras.showPrePopup = true
extras.showPostPopup = true
request.registerAdNetworkExtras(extras)

Objective-C

Request *request = [Request request];
GADMAdapterAdColonyExtras *extras = [[GADMAdapterAdColonyExtras alloc] init];
extras.showPrePopup = YES;
extras.showPostPopup = YES;
[request registerAdNetworkExtras:extras];

Verify your adapter and SDK versions

To log the adapter and SDK versions, use the following code snippet:

Class<GADMediationAdapter> adapterClass = NSClassFromString(@"GADMediationAdapterAdColony");
if (adapterClass != nil) {
  GADVersionNumber adapterVersion = [adapterClass version];
  GADVersionNumber sdkVersion = [adapterClass adSDKVersion];
  // Log the adapter patch version to 3 digits to represent the x.x.x.x versioning
  // used by adapters.
  NSLog(@"Adapter version: %zd.%zd.%03zd",
        adapterVersion.majorVersion,
        adapterVersion.minorVersion,
        adapterVersion.patchVersion);
  NSLog(@"SDK version: %zd.%zd.%zd",
        sdkVersion.majorVersion,
        sdkVersion.minorVersion,
        sdkVersion.patchVersion);
}

Logging the adapter version in Swift is not possible since the dynamic runtime feature does not exist in Swift, making it infeasible to dynamically create the class from the class name. If this is needed in Swift, it needs to be written in Objective-C and imported using a bridging header.

Error codes

If the adapter fails to receive an ad from AdColony, publishers can check the underlying error from the ad response using GADResponseInfo.adNetworkInfoArray under the following classes:

GADMAdapterAdColony
GADMediationAdapterAdColony

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

Error code Reason
0 - 3 AdColony SDK returned an error. See documentation for more details.
101 Invalid server parameters (e.g. missing Zone ID).
102 Root view controller presenting the ad is nil.
103 The AdColony SDK returned an initialization error.
104 The AdColony SDK does not support being configured twice within a five second period.
105 Failed to show ad.
106 Zone used for rewarded is not a rewarded zone on AdColony portal.

AdColony iOS Mediation Adapter Changelog

Next Version

  • Removed support of the armv7 architecture.
  • Now requires minimum iOS version 11.0.
  • Now requires Google Mobile Ads SDK version 10.4.0 or higher.
  • Removed the deprecated willBackgroundApplication delegate method from the banner and interstitial renderers.
  • Replaced the deprecated childDirectedTreatment method with GADMobileAds.sharedInstance.requestConfiguration.tagForChildDirectedTreatment.

Version 4.9.0.2

  • Updated the adapter to pass childDirectedTreatment information to the AdColony SDK.

Built and tested with

  • Google Mobile Ads SDK version 10.1.0.
  • AdColony SDK version 4.9.0.

Version 4.9.0.1

  • Updated the adapter to use the didRewardUser API.
  • Fixed an issue where UI related API methods are being called on a background thread.
  • Removed use of deprecated gender, birthday and location mediation APIs.
  • Now requires Google Mobile Ads SDK version 10.0.0 or higher.

Built and tested with

  • Google Mobile Ads SDK version 10.0.0.
  • AdColony SDK version 4.9.0.

Version 4.9.0.0

  • Verified compatibility with AdColony SDK 4.9.0.

Built and tested with

  • Google Mobile Ads SDK version 9.5.0.
  • AdColony SDK version 4.9.0.

Version 4.8.0.0

  • Verified compatibility with AdColony SDK 4.8.0.

Built and tested with

  • Google Mobile Ads SDK version 9.1.0.
  • AdColony SDK version 4.8.0.

Version 4.7.2.2

  • Added support for the arm64 simulator architecture.

Built and tested with

  • Google Mobile Ads SDK version 9.0.0.
  • AdColony SDK version 4.7.2.

Version 4.7.2.1

  • Verified compatibility with Google Mobile Ads SDK version 9.0.0.
  • Now requires Google Mobile Ads SDK version 9.0.0 or higher.
  • Now requires minimum iOS version of 10.0.

Built and tested with

  • Google Mobile Ads SDK version 9.0.0.
  • AdColony SDK version 4.7.2.

Version 4.7.2.0

  • Verified compatibility with AdColony SDK 4.7.2.

Built and tested with

  • Google Mobile Ads SDK version 8.10.0.
  • AdColony SDK version 4.7.2.

Version 4.7.1.0

  • Verified compatibility with AdColony SDK 4.7.1.

Built and tested with

  • Google Mobile Ads SDK version 8.9.0.
  • AdColony SDK version 4.7.1.

Version 4.7.0.0

  • Verified compatibility with AdColony SDK 4.7.0.
  • Relaxed dependency to Google Mobile Ads SDK version 8.0.0 or higher.

Built and tested with

  • Google Mobile Ads SDK version 8.8.0.
  • AdColony SDK version 4.7.0.

Version 4.6.1.0

  • Verified compatibility with AdColony SDK 4.6.1.
  • Now requires Google Mobile Ads SDK version 8.4.0 or higher.

Built and tested with

  • Google Mobile Ads SDK version 8.4.0.
  • AdColony SDK version 4.6.1.

Version 4.6.0.0

  • Updated the adapter to use the .xcframework format.
  • Added bidding capability for banner ads.
  • Verified compatibility with AdColony SDK 4.6.0.
  • Now requires Google Mobile Ads SDK version 8.3.0 or higher.

Built and tested with

  • Google Mobile Ads SDK version 8.3.0.
  • AdColony SDK version 4.6.0.

Version 4.5.0.0

  • Verified compatibility with AdColony SDK 4.5.0.
  • Now requires Google Mobile Ads SDK version 7.69.0 or higher.

Built and tested with

  • Google Mobile Ads SDK version 7.69.0.
  • AdColony SDK version 4.5.0.

Version 4.4.1.0

  • Verified compatibility with AdColony SDK 4.4.1.
  • Now requires Google Mobile Ads SDK version 7.66.0 or higher.

Built and tested with

  • Google Mobile Ads SDK version 7.66.0.
  • AdColony SDK version 4.4.1.

Version 4.4.0.0

  • Verified compatibility with AdColony SDK 4.4.0.
  • Now requires Google Mobile Ads SDK version 7.65.0 or higher.

Built and tested with

  • Google Mobile Ads SDK version 7.65.0.
  • AdColony SDK version 4.4.0.

Version 4.3.1.0

  • Verified compatibility with AdColony SDK 4.3.1.

Built and tested with

  • Google Mobile Ads SDK version 7.64.0.
  • AdColony SDK version 4.3.1.

Version 4.3.0.0

  • Verified compatibility with AdColony SDK 4.3.0.
  • Now requires Google Mobile Ads SDK version 7.64.0 or higher.

Built and tested with

  • Google Mobile Ads SDK version 7.64.0.
  • AdColony SDK version 4.3.0.

Version 4.1.5.0

  • Verified compatibility with AdColony SDK 4.1.5.
  • Updated the minimum required Google Mobile Ads SDK version to 7.60.0.

Built and tested with

  • Google Mobile Ads SDK version 7.60.0.
  • AdColony SDK version 4.1.5.

Version 4.1.4.1

  • Added standardized adapter error codes and messages.
  • Removed support for the i386 architecture.

Built and tested with

  • Google Mobile Ads SDK version 7.57.0.
  • AdColony SDK version 4.1.4.

Version 4.1.4.0

  • Verified compatibility with AdColony SDK 4.1.4.

Built and tested with

  • Google Mobile Ads SDK version 7.56.0.
  • AdColony SDK version 4.1.4.

Version 4.1.3.1

  • Fixed AdColony mediation network adapter version string.

Built and tested with

  • Google Mobile Ads SDK version 7.55.0.
  • AdColony SDK version 4.1.3.

Version 4.1.3.0 (Deprecated)

  • Known issue: Incorrectly reports the mediation adapter version as 4.1.2.0. Please use version 4.1.3.1 or higher.
  • Verified compatibility with AdColony SDK 4.1.3.
  • Adding code to re-request ads for OB requests when the AdColony ad expires.

Built and tested with

  • Google Mobile Ads SDK version 7.55.0.
  • AdColony SDK version 4.1.3.

Version 4.1.2.0

  • Verified compatibility with AdColony SDK 4.1.2.
  • Added support for banner ads.

Built and tested with

  • Google Mobile Ads SDK version 7.52.0.
  • AdColony SDK version 4.1.2.

Version 4.1.1.0

  • Verified compatibility with AdColony SDK 4.1.1.
  • Added support for banner ads.

Built and tested with

  • Google Mobile Ads SDK version 7.52.0.
  • AdColony SDK version 4.1.1.

Version 3.3.8.1.0

  • Updating AdColony adapter to version 3.3.8.1.
  • Linting the code to follow Google's Objective-C code-style and guard against potential crashes.

Built and tested with

  • Google Mobile Ads SDK version 7.51.0
  • AdColony SDK version 3.3.8.1

Version 3.3.7.3

  • Added checks to the credentials before initializing the AdColony SDK.

Version 3.3.7.2

  • Fixed an issue where the GADMediationAdapterAdColony header was not made public.

Version 3.3.7.1

  • Added bidding capability to the adapter for interstitial and rewarded ads.

Version 3.3.7.0

  • Verified compatibility with AdColony SDK 3.3.7.
  • Fixed a crash in case of failed to fetch rewarded ad.

Version 3.3.6.1

  • Updated the adapter to use the new rewarded API.
  • Now requires Google Mobile Ads SDK version 7.41.0 or higher.

Version 3.3.6.0

  • Verified compatibility with AdColony SDK 3.3.6.

Version 3.3.5.0

  • Verified compatibility with AdColony SDK 3.3.5.
  • Added adapterDidCompletePlayingRewardBasedVideoAd: callback to the adapter.

Version 3.3.4.0

  • Verified compatibility with AdColony SDK 3.3.4.

Version 3.3.0.0

  • Verified compatibility with AdColony SDK 3.3.0.

Version 3.2.1.1

  • Added testMode to extras. Publishers can use this property to mark AdColony requests as test requests.

Version 3.2.1.0

  • Verified compatibility with AdColony SDK 3.2.1.

Version 3.2.0.0

  • Verified compatibility with AdColony SDK 3.2.0.

Version 3.1.1.1

  • Removed support for the armv7s architecture.
  • Fixed an issue that caused the adapter to incorrectly invoke the rewarded callback when used with recent versions of the AdColony SDK.

Version 3.1.1.0

  • Verified compatibility with AdColony SDK 3.1.1.

Version 3.1.0.0

  • Verified compatibility with AdColony SDK 3.1.0.

Version 3.0.6.0

  • Changed the version naming system to [AdColony SDK version].[adapter patch version].
  • Updated the minimum required AdColony SDK to v3.0.6.

Earlier Versions