Integrating AdColony with Mediation

This guide is intended for publishers who want to use the Google Mobile Ads SDK to load and display ads from AdColony via mediation. It covers how to add AdColony to an ad unit's mediation configuration, how to set up Ad Network Optimization (ANO), and how to integrate the AdColony SDK and adapter into an iOS app.

Supported ad formats and features

The AdMob mediation adapter for AdColony has the following capabilities:

Formats
Banners
Interstitials
Rewarded Video
Native Advanced
Features
Smart Banners
Ad Network Optimization (ANO)

Requirements

  • Xcode 7.0 or higher
  • iOS Deployment target of 7.0 or higher
  • Minimum required Google Mobile Ads SDK 7.10.1 or higher

Step 1: Set up AdColony

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 setup zone

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

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 Video

  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.

AdColony zone id

In addition to the App ID and the Zone ID you will also 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

Step 2: Configure mediation settings for your AdMob ad unit

You need to add AdColony to the mediation configuration for your ad unit. First sign in to your AdMob account.

Next, navigate to the Mediation tab. If you have an existing mediation group you'd like to modify, click the name of that mediation group to edit it, and skip ahead to Add AdColony as an ad source.

To create a new mediation group, select Create Mediation Group.

AdMob Beta mediation tab

Enter your ad format and platform, then click Continue.

Give your mediation group a name, and select locations to target. Next, set the mediation group status to Enabled. Then click Add Ad Units, which will open up the ad unit selection overlay.

New mediation group 2

Associate this mediation group with your existing AdMob ad unit. Then click Done.

Select ad unit

You should now see the ad units card populated with the ad units you selected.

Mediation group ad units

Add AdColony as an ad source

In the Ad Sources card, select Add Ad Network. Then select AdColony.

Enable the Optimize switch. Enter your API Key obtained in the previous section to set up ANO for AdColony. Then enter an eCPM value for AdColony and click Continue.

Next, enter the App ID and Zone ID obtained in the previous section. Then click Done.

Configure AdColony ad unit

Finally, click Save.

Using rewarded video ads

In the settings for your rewarded video ad unit, check the Override reward settings from third-party ad networks when using AdMob mediation so that you provide the same reward to the user no matter which ad network is served.

If you don't override the reward, the AdColony adapter passes back the reward specified in the AdColony dashboard.

For more information on setting reward values for AdMob ad units, see Create an ad unit.

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 version of the AdColonyAdapter, 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: Additional code required

No additional code is required for AdColony integration.

Step 5: Test your implementation

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

Optional steps

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 section below shows you how to enable or disable personalized ads for AdColony.

In version 3.3.4.0, the AdColony adapter added the gdprRequired and gdprConsentString properties to the GADMAdapterAdColonyExtras class. The following sample code sets gdprRequired to YES and gdprConsentString to 1. These extras are passed to the AdColony adapter and are used to initialize the AdColony SDK.

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

GADRequest *request = [GADRequest request];
GADMAdapterAdColonyExtras *extras = [[GADMAdapterAdColonyExtras alloc] init];
extras.gdprRequired = YES;
extras.gdprConsentString = @"1";
[request registerAdNetworkExtras: extras];

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

Using interstitial and rewarded video 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:

  • userId - Set a unique userID for a specific ad request in your application.
  • showPrePopup - Enable a reward dialog before showing the ad for a specific ad request in your application.
  • showPostPopup - Enable a reward dialog after showing the ad for a specific ad request in your application.
  • testMode - Enable test ads for your application without changing dashboard settings.

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

Swift

let request = GADRequest()
let extras = GADMAdapterAdColonyExtras()
extras.userId = "USER_ID"
extras.showPrePopup = true
extras.showPostPopup = true
extras.testMode = true
request.registerAdNetworkExtras(extras)

Objective-C

GADRequest *request = [GADRequest request];
GADMAdapterAdColonyExtras *extras = [[GADMAdapterAdColonyExtras alloc] init];
extras.userId = @"USER_ID";
extras.showPrePopup = YES;
extras.showPostPopup = YES;
extras.testMode = YES;
[request registerAdNetworkExtras:extras];

Optimizations

To ensure AdColony video ads are available as early as possible, you can optionally initialize the AdColony SDK at the beginning of the application lifecycle. To do so, insert the following code into the application:didFinishLaunchingWithOptions: method:

Swift

AdColony.configure(withAppID: "YOUR_ADCOLONY_APP_ID",
                     zoneIDs: ["Zone_ID_1", "Zone_ID_2"],
                     options: options) { _ in }

Objective-C

[AdColony configureWithAppID:@"YOUR_ADCOLONY_APP_ID"
                     zoneIDs:@[@"Zone_ID_1", @"Zone_ID_2"]
                     options:options
                  completion:nil];

Send feedback about...

Google Mobile Ads SDK for iOS
Google Mobile Ads SDK for iOS
Need help? Visit our support page.