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 DFP mediation adapter for AdColony has the following capabilities:

Formats
Banners
Interstitials
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 DFP even if you already have one.

AdColony setup zone

Set Zone is active? to Yes, and then enter a Name for your Ad Zone. Choose Video as the Ad Zone’s Creative Type and Preroll/Interstitial as the Zone Type.

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 DFP 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 DFP ad unit

Sign in to your DFP account. Navigate to Delivery > Yield Groups and click the Create Yield Group button.

DFP create yield group button

Enter a Yield Group Name, select your Ad Format, and set the Environment to Mobile App. Under the Targeting section, select the ad unit ID to which you want to add mediation.

DFP create yield group

Next, click the + Add Another Yield Partner button.

If you already have a Yield Partner for AdColony, you can simply select it. Otherwise, select Create a new Yield Partner.

Select AdColony as the Yield partner and enter a unique Name. Check the checkbox for Enable automatic data collection of estimated CPM to optimize Mediation to enable ANO, and enter the API Key obtained in the previous section. No need to enter a username and password API key is all that's required. Click Save when done.

Once the Yield partner is chosen, select Mobile SDK mediation as the Integration type and iOS as the Operating system. Enter the App ID and Zone ID obtained in the previous section. Enter a Default CPM value.

Click Save and Activate at the bottom of the page when done.

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.

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

Using interstitial 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.

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

GADRequest *request = [GADRequest request];
GADMAdapterAdColonyExtras *extras = [[GADMAdapterAdColonyExtras alloc] init];
extras.userId = @"USER_ID";
extras.showPrePopup = YES;
extras.showPostPopup = 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:

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

Send feedback about...

SDK for DFP Users on iOS
Need help? Visit our support page.