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 a Unity app.

Supported ad formats and features

The AdMob mediation adapter for AdColony has the following capabilities:

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

Requirements

  • Unity 4 or higher
  • To deploy on Android
    • Android SDK 4.0 (API level 14) or later
    • Google Play services 9.8.0 or later
  • To deploy on iOS
    • Xcode 7.0 or higher
    • iOS Deployment target of 7.0 or higher
    • Minimum required Google Mobile Ads SDK 7.10.1 or higher
  • A working Unity project configured with Google Mobile Ads SDK. See the Quick Start Guide for details.

Step 1: Set up AdColony

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

If your app supports both Android and iOS platforms, you need to set up each one of them separately.

AdColony setup new app

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

Android

AdColony create app

iOS

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.

Android

AdColony app id

iOS

AdColony app id

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

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.

When finished, click the Create button to create the Ad Zone.

Once the Ad Zone is created, you can locate your Zone ID under the Integration section.

AdColony zone id

In addition to the App ID and the Zone ID you will also need your AdColony API Key to set 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 into the AdMob UI.

If you're deploying your Unity app to both Android and iOS, you need two AdMob ad units, one for each platform.

Next, follow the instructions for either AdMob or AdMob Beta depending on which version of the AdMob UI you're using.

AdMob Android

Navigate to the Monetize tab and select your application from the list of all your applications on the left-hand side. Click the link in the mediation column for the ad unit you want to add AdColony.

AdColony ad unit

Click NEW AD NETWORK.

Select AdColony from the list of networks provided and enter the App ID and the Zone ID obtained in the previous section.

AdColony select adcolony

Enter your API Key obtained in the previous section to set up ANO for AdColony.

Click Continue at the bottom of the page to complete adding the network. Enter an eCPM value for AdColony and click Save.

AdMob iOS

Navigate to the Monetize tab and select your application from the list of all your applications on the left-hand side. Click the link in the mediation column for the ad unit you want to add AdColony.

AdColony ad unit

Click NEW AD NETWORK.

Select AdColony from the list of networks provided and enter the App ID and the Zone ID obtained in the previous section.

AdColony select adcolony

Enter your API Key obtained in the previous section to set up ANO for AdColony.

Click Continue at the bottom of the page to complete adding the network. Enter an eCPM value for AdColony and click Save.

AdMob Beta Android

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.

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.

Finally, click Save.

AdMob Beta iOS

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.

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.

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 (recommended approach).

Mediation override reward

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

Android

  1. Download the latest version of AdColony Android SDK.
    • Extract adcolony.jar (located in the Library/ directory) and add it to the Assets/Plugins/Android directory in your Unity project.
    • Next, create a libs directory under the Assets/Plugins/Android directory.
    • Then, extract the armeabi-v7a/ and x86/ directories from the Library/ directory and add them to the libs directory.
  2. Download the latest AdColony adapter (adcolony-3.3.0.0.aar) from Bintray and add it to the Assets/Plugins/Android directory in your Unity project.

iOS

  1. Download the latest version of the AdColony SDK.
  2. Download the latest version of the AdColony adapter.
  3. Add both the .framework bundles in your Unity project under the Assets/Plugins/iOS directory.

Step 4: Additional code required

Android

Modify Android manifest

Activities

Include the following Activities inside the application tag of the AndroidManifest.xml file located under the Assets/Plugins/Android/GoogleMobileAdsPlugin directory of your Unity project.

<activity android:name="com.adcolony.sdk.AdColonyInterstitialActivity"
    android:configChanges="keyboardHidden|orientation|screenSize"
    android:hardwareAccelerated="true"/>

<activity android:name="com.adcolony.sdk.AdColonyAdViewActivity" android:configChanges="keyboardHidden|orientation|screenSize" android:hardwareAccelerated="true"/>

iOS

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

Android

Permissions

For optimal performance, AdColony recommends adding the following optional permissions into the AndroidManifest.xml file located under the Assets/Plugins/Android/GoogleMobileAdsPlugin directory of your Unity project.

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE" />

iOS

No additional steps required for iOS integration.

Send feedback about...

AdMob for Unity
AdMob for Unity
Need help? Visit our support page.