Integrate AdColony with Mediation

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 Ad Manager 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 Ad Manager 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 Ad Manager 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 Ad Manager UI

Sign in to your Ad Manager account.

Add AdColony in Companies

Bidding

This step isn't required for bidding integrations.

Waterfall

Navigate to Admin > Companies, then click the New company button in the All companies tab. Select Ad network.

Select AdColony as the Ad network, enter a unique Name and enable Mediation. Turn on Automatic data collection, and enter the API Key obtained in the previous section.

You don't need to enter a Username or Password. Click Save when done.

Enable secure signal sharing

Bidding

Navigate to Admin > Global settings. Go to the Ad Exchange account settings tab and review and toggle on Secure signal sharing. Click Save.

Waterfall

This step isn't required for waterfall integrations.

Configure AdColony bidding

Bidding

Navigate to Delivery > Bidders, and click New bidder under the SDK Bidding tab.

Select AdColony as the bidder.

Toggle on Add this bidder's signal library to the list of allowed signals and Allow signals to be shared with this bidder. Then, click Continue.

Click Continue.

Click Done.

Waterfall

This step isn't required for waterfall integrations.

Configure ad unit mapping

Bidding

Navigate to Delivery > Bidders, and select the company for AdColony under the SDK Bidding tab.

Go to the Ad unit mapping tab and click New ad unit mapping.

Choose Specific ad unit. Select an ad unit and format, Mobile app as the Inventory type, and your Mobile application. Then, enter App ID and Zone ID obtained in the previous section. Finally, click Save.

Waterfall

Navigate to Delivery > Yield groups and click the New yield group button. Select your Mobile application.

Scroll down and click Add yield partner.

Select the company you created for AdColony in the previous section. Choose Mobile SDK mediation as the Integration type, iOS as the Platform, and Active as the Status.

Enter the App ID and Zone ID obtained in the previous section, and the Default CPM value. Click Save.

Note: Automatic data collection takes a few days to gather data before it can accurately calculate a Dynamic CPM value for a mediation network. Once the eCPM can be calculated, it is automatically updated on your behalf.

Add AdColony to GDPR and US state regulations ad partners list

Follow the steps in GDPR settings and US state regulations settings to add AdColony to the GDPR and US state regulations ad partners list in the Ad Manager UI.

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

Enable test ads

Make sure you register your test device for Ad Manager and enable test mode in AdColony UI.

Verify test ads

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

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 = GAMRequest()
let extras = GADMAdapterAdColonyExtras()
extras.showPrePopup = true
extras.showPostPopup = true
request.registerAdNetworkExtras(extras)

Objective-C

GAMRequest *request = [GAMRequest 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