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 Android 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
- Android API level 21 or higher
- [For bidding]: AdColony adapter 3.3.10.1 or higher (latest version recommended)
Latest Google Mobile Ads SDK
Complete the mediation Get started guide
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.
Fill out the form and click Create at the bottom of the page to add your app to AdColony.
Once your app is created you can obtain your App ID by navigating to Monetization > Apps under your app's Basic App Information section.
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.
For additional instructions on creating an ad placement, select the tab corresponding to your preferred ad format.
Banner
- Set Zone is Active? to Yes.
Enter a Name for your Ad Zone.
Choose Banner as the Ad Zone Size.
Enter a value for the Daily play cap.
Interstitial
- Set Zone is Active? to Yes.
Enter a Name for your Ad Zone.
Choose Preroll/Interstitial as the Zone Type.
Enter a value for the Daily play cap.
Rewarded
- Set Zone is Active? to Yes.
Enter a Name for your Ad Zone.
Choose Value Exchange/V4VC as the Zone Type.
Set Client Side Only? to Yes and enter a Virtual Currency Name, Daily Max Videos per User and Reward Amount.
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.
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.
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.
Step 2: Set up AdColony demand in AdMob UI
광고 단위에 대한 미디에이션 설정 구성
AdColony 를 광고 단위의 미디에이션 구성에 추가해야 합니다.
먼저 AdMob 계정에 로그인합니다. 그런 다음 미디에이션 탭으로 이동합니다. 수정할 기존 미디에이션 그룹이 있는 경우 해당 미디에이션 그룹의 이름을 클릭하여 수정한 후 AdColony 광고 소스로 추가로 건너뜁니다.
새 미디에이션 그룹을 만들려면 미디에이션 그룹 만들기를 선택합니다.
광고 형식과 플랫폼을 입력하고 계속을 클릭합니다.
미디에이션 그룹에 이름을 지정하고 타겟팅할 위치를 선택합니다. 미디에이션 그룹 상태를 사용으로 설정한 다음 광고 단위 추가를 클릭합니다.
이 미디에이션 그룹을 하나 이상의 기존AdMob 광고 단위와 연결합니다. 그런 다음 완료를 클릭합니다.
이제 광고 단위 카드가 선택한 광고 단위로 채워진 것을 볼 수 있습니다.
광고 소스로 AdColony 추가
입찰
광고 소스 섹션의 입찰 카드에서 광고 소스 추가를 선택합니다. 그런 다음 AdColony을 선택합니다.
파트너십 계약을 체결하는 방법을 클릭하고AdColony과(와) 입찰 파트너십을 설정합니다.
확인 및 동의를 클릭한 다음 계속을 클릭합니다.
이미 AdColony에 대한 매핑이 있는 경우 해당 매핑을 선택할 수 있습니다. 그렇지 않으면 매핑 추가를 클릭합니다.
그런 다음 이전 섹션에서 얻은 App ID and Zone ID를 입력합니다. 그런 다음 완료를 클릭합니다.
중요: App ID 는AdColony UI에서와 같이 타겟팅된 앱과 연결되어야 합니다.폭포
광고 소스 섹션의 폭포식 구조 카드에서 광고 소스 추가를 선택합니다. 그런 다음 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 설정 및 미국 주 규정 설정 AdColony 를 AdMob UI의 GDPR 및 미국 주 규정 광고 파트너 목록에 추가합니다.
Step 3: Import the AdColony SDK and adapter
Android Studio integration (recommended)
In your app-level build.gradle.kts
file, add the following implementation
dependencies and configurations. Use the latest versions of the AdColony SDK
and adapter:
dependencies {
implementation("com.google.android.gms:play-services-ads:23.0.0")
implementation("com.google.ads.mediation:adcolony:4.8.0.2")
}
Migrate project to AndroidX
The AdColony SDK depends on Android support libraries but the latest Google Mobile Ads SDK uses Jetpack libraries.
To ensure the AdColony SDK and the Google Mobile Ads SDK are compatible, create
a gradle.properties
file in the top-level of your project, and add the
following code:
android.useAndroidX=true
android.enableJetifier=true
This will rewrite the AdColony SDK binary to use use Jetpack libraries. See AndroidX migration guide for more information about these settings.
Manual integration
- Download the
AdColony Android SDK and
extract the
adcolony.jar
under theLibrary
folder and add it to your project. - The AdColony SDK depends on the Annotations Support Library. See Improve Code Inspection with Annotations for details on how to add the Annotations Support Library to your project.
- Navigate to the AdColony adapter artifacts on Google's Maven Repository. Select the latest version, download the AdColony adapter's .aar file, and add it to your project.
Step 4: Implement privacy settings on AdColony SDK
EU Consent and GDPR
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 provides the AdColonyMediationAdapter.getAppOptions()
method to customize parameters to be sent to AdColony's SDK. Two methods
relevant to GDPR on these options are setPrivacyFrameworkRequired()
and
setPrivacyConsentString()
. 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.
Java
import com.google.ads.mediation.adcolony.AdColonyMediationAdapter;
//...
AdColonyAppOptions appOptions = AdColonyMediationAdapter.getAppOptions();
appOptions.setPrivacyFrameworkRequired(AdColonyAppOptions.GDPR, true);
appOptions.setPrivacyConsentString(AdColonyAppOptions.GDPR, "1");
Kotlin
import com.google.ads.mediation.adcolony.AdColonyMediationAdapter
//...
val appOptions = AdColonyMediationAdapter.getAppOptions()
appOptions.setPrivacyFrameworkRequired(AdColonyAppOptions.GDPR, true)
appOptions.setPrivacyConsentString(AdColonyAppOptions.GDPR, "1")
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 provides the AdColonyMediationAdapter.getAppOptions()
method to customize parameters to be sent to AdColony's SDK. Two methods
relevant to CCPA on these options are setPrivacyFrameworkRequired()
and
setPrivacyConsentString()
. 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.
Java
import com.google.ads.mediation.adcolony.AdColonyMediationAdapter;
//...
AdColonyAppOptions appOptions = AdColonyMediationAdapter.getAppOptions();
appOptions.setPrivacyFrameworkRequired(AdColonyAppOptions.CCPA, true);
appOptions.setPrivacyConsentString(AdColonyAppOptions.CCPA, "1");
Kotlin
import com.google.ads.mediation.adcolony.AdColonyMediationAdapter
//...
val appOptions = AdColonyMediationAdapter.getAppOptions()
appOptions.setPrivacyFrameworkRequired(AdColonyAppOptions.CCPA, true)
appOptions.setPrivacyConsentString(AdColonyAppOptions.CCPA, "1")
See AdColony's CCPA implementation details for more details about what values may be provided in these methods.
Step 5: Add required code
No additional code is required for AdColony integration.
Step 6: Test your implementation
테스트 광고 사용 설정
AdMob 용 테스트 기기를 등록하고 AdColony UI에서 테스트 모드를 사용 설정해야 합니다.
테스트 광고 확인
AdColony에서 테스트 광고를 수신하고 있는지 확인하려면 광고 검사기에서 AdColony (Bidding) and AdColony (Waterfall) 광고 소스를 사용하여 단일 광고 소스 테스트를 사용 설정하세요.
Optional steps
Permissions
For optimal performance, AdColony recommends adding the following optional
permissions
to your app's AndroidManifest.xml
file:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE" />
Using interstitial and rewarded ads
Network-specific parameters
The AdColony adapter supports additional request parameters which can be passed
to the adapter using the AdColonyBundleBuilder
class. The
AdColonyBundleBuilder
includes the following methods:
setShowPrePopup(boolean)
: Sets whether or not to show a popup before showing an ad. Set to false for no popup before ad shows.setShowPostPopup(boolean)
: Sets whether or not to show a popup after showing an ad. Set to false for no popups after ad shows.
Here's a code example of how to set these ad request parameters:
Java
AdColonyBundleBuilder.setShowPrePopup(true);
AdColonyBundleBuilder.setShowPostPopup(true);
AdRequest request = new AdRequest.Builder()
.addNetworkExtrasBundle(AdColonyAdapter.class, AdColonyBundleBuilder.build())
.build();
rewardedInterstitialAd.loadAd(request);
Kotlin
AdColonyBundleBuilder.setShowPrePopup(true)
AdColonyBundleBuilder.setShowPostPopup(true)
val request = AdRequest.Builder()
.addNetworkExtrasBundle(AdColonyAdapter::class.java, AdColonyBundleBuilder.build())
.build()
rewardedInterstitialAd.loadAd(request)
Verify your adapter and SDK versions
To log the adapter and SDK versions, use the following code snippet:
AdColonyMediationAdapter adapter = new AdColonyMediationAdapter();
VersionInfo adapterVersion = adapter.getVersionInfo();
VersionInfo sdkVersion = adapter.getSDKVersionInfo();
// Log the adapter patch version to 3 digits to represent the x.x.x.x versioning
// used by adapters.
Log.d("TAG", String.format(
"Adapter version: %d.%d.%03d",
adapterVersion.getMajorVersion(),
adapterVersion.getMinorVersion(),
adapterVersion.getMicroVersion()));
Log.d("TAG", String.format(
"SDK version: %d.%d.%d",
sdkVersion.getMajorVersion(),
sdkVersion.getMinorVersion(),
sdkVersion.getMicroVersion()));
Error codes
If the adapter fails to receive an ad from AdColony, publishers can check the
underlying error from the ad response using
ResponseInfo.getAdapterResponse()
under the following classes:
com.jirbo.adcolony.AdColonyAdapter
com.google.ads.mediation.adcolony.AdColonyMediationAdapter
Here are the codes and accompanying messages thrown by the AdColony adapter when an ad fails to load:
Error code | Reason |
---|---|
100 | The AdColony SDK returned an error. |
101 | Invalid server parameters (e.g. missing Zone ID). |
102 | An ad was already requested for the same Zone ID. |
103 | The AdColony SDK returned an initialization error. |
104 | The requested banner size does not map to a valid AdColony ad size. |
105 | Presentation error due to ad not loaded. |
106 | Context used to initialize the AdColony SDK was not an Activity instance. |
AdColony Android Mediation Adapter Changelog
Next Version
- Updated the minimum required Google Mobile Ads SDK version to 22.4.0.
Version 4.8.0.2
- Updated adapter to use new
VersionInfo
class. - Updated the minimum required Google Mobile Ads SDK version to 22.0.0.
Built and tested with:
- Google Mobile Ads SDK version 22.0.0.
- AdColony SDK version 4.8.0.
Version 4.8.0.1
- Added support for forwarding COPPA information to the AdColony SDK.
- Updated the minimum required Google Mobile Ads SDK version to 21.5.0.
Built and tested with:
- Google Mobile Ads SDK version 21.5.0.
- AdColony SDK version 4.8.0.
Version 4.8.0.0
- Verified compatibility with AdColony SDK version 4.8.0.
Built and tested with:
- Google Mobile Ads SDK version 21.0.0.
- AdColony SDK version 4.8.0.
Version 4.7.1.1
- Updated
compileSdkVersion
andtargetSdkVersion
to API 31. - Updated the minimum required Google Mobile Ads SDK version to 21.0.0.
- Updated the minimum required Android API level to 19.
Built and tested with:
- Google Mobile Ads SDK version 21.0.0.
- AdColony SDK version 4.7.1.
Version 4.7.1.0
- Verified compatibility with AdColony SDK version 4.7.1.
Built and tested with:
- Google Mobile Ads SDK version 20.6.0.
- AdColony SDK version 4.7.1.
Version 4.7.0.0
- Verified compatibility with AdColony SDK version 4.7.0.
- Updated the minimum required Google Mobile Ads SDK version to 20.6.0.
Built and tested with:
- Google Mobile Ads SDK version 20.6.0.
- AdColony SDK version 4.7.0.
Version 4.6.5.0
- Verified compatibility with AdColony SDK version 4.6.5.
Built and tested with:
- Google Mobile Ads SDK version 20.4.0.
- AdColony SDK version 4.6.5.
Version 4.6.4.0
- Verified compatibility with AdColony SDK version 4.6.4.
Built and tested with:
- Google Mobile Ads SDK version 20.4.0.
- AdColony SDK version 4.6.4.
Version 4.6.3.0
- Verified compatibility with AdColony SDK version 4.6.3.
- Updated the minimum required Google Mobile Ads SDK version to 20.4.0.
Built and tested with:
- Google Mobile Ads SDK version 20.4.0.
- AdColony SDK version 4.6.3.
Version 4.6.2.0
- Verified compatibility with AdColony SDK version 4.6.2.
Built and tested with:
- Google Mobile Ads SDK version 20.3.0.
- AdColony SDK version 4.6.2.
Version 4.6.0.0
- Verified compatibility with AdColony SDK version 4.6.0.
- Updated the minimum required Google Mobile Ads SDK version to 20.3.0.
Built and tested with:
- Google Mobile Ads SDK version 20.3.0.
- AdColony SDK version 4.6.0.
Version 4.5.0.0
- Added support for banners advanced bidding.
- Verified compatibility with AdColony SDK version 4.5.0.
- Updated the minimum required Google Mobile Ads SDK version to 20.0.0.
Built and tested with:
- Google Mobile Ads SDK version 20.0.0.
- AdColony SDK version 4.5.0.
Version 4.4.1.0
- Verified compatibility with AdColony SDK version 4.4.1.
Built and tested with:
- Google Mobile Ads SDK version 19.7.0.
- AdColony SDK version 4.4.1.
Version 4.4.0.0
- Verified compatibility with AdColony SDK version 4.4.0.
- Added support of AdColony's
collectSignals()
method for bidding. - Updated the minimum required Google Mobile Ads SDK version to 19.7.0.
Built and tested with:
- Google Mobile Ads SDK version 19.7.0.
- AdColony SDK version 4.4.0.
Version 4.3.0.0
- Verified compatibility with AdColony SDK version 4.3.0.
- Updated the minimum required Google Mobile Ads SDK version to 19.5.0.
Built and tested with:
- Google Mobile Ads SDK version 19.5.0.
- AdColony SDK version 4.3.0.
Version 4.2.4.0
- Fixed a bug where
onUserEarnedReward()
was not forwarded for rewarded ads. - Added additional error codes for AdColony SDK initialization errors.
- Updated the minimum required Google Mobile Ads SDK version to 19.4.0.
Built and tested with:
- Google Mobile Ads SDK version 19.4.0.
- AdColony SDK version 4.2.4.
Version 4.2.0.0
- Verified compatibility with AdColony SDK version 4.2.0.
- Updated the adapter to support inline adaptive banner requests.
- Updated the minimum required Google Mobile Ads SDK version to 19.2.0.
Built and tested with:
- Google Mobile Ads SDK version 19.2.0.
- AdColony SDK version 4.2.0.
Version 4.1.4.1
- Added descriptive error codes and reasons for adapter load/show failures.
- Updated the minimum required Google Mobile Ads SDK version to 19.0.1.
Built and tested with:
- Google Mobile Ads SDK version 19.0.1.
- AdColony SDK version 4.1.4.
Version 4.1.4.0
- Verified compatibility with AdColony SDK version 4.1.4.
Built and tested with:
- Google Mobile Ads SDK version 18.3.0.
- AdColony SDK version 4.1.4.
Version 4.1.3.1
- Fixed an issue where the
onRewardedAdLoaded()
callback is not being forwarded by the adapter.
Built and tested with:
- Google Mobile Ads SDK version 18.3.0.
- AdColony SDK version 4.1.3.
Version 4.1.3.0
- Verified compatibility with AdColony SDK version 4.1.3.
Built and tested with:
- Google Mobile Ads SDK version 18.3.0.
- AdColony SDK version 4.1.3.
Version 4.1.2.0
- Verified compatibility with AdColony SDK version 4.1.2.
- Updated the minimum required Google Mobile Ads SDK version to 18.3.0.
Built and tested with:
- Google Mobile Ads SDK version 18.3.0.
- AdColony SDK version 4.1.2.
Version 4.1.0.0
- Verified compatibility with AdColony SDK version 4.1.0.
- Added support for banner ads.
- Updated the minimum required Google Mobile Ads SDK version to 18.2.0.
Built and tested with:
- Google Mobile Ads SDK version 18.2.0.
- AdColony SDK version 4.1.0.
Version 3.3.11.0
- Verified compatibility with AdColony SDK version 3.3.11.
- Updated the minimum required Google Mobile Ads SDK version to 18.1.1.
Version 3.3.10.1
- Added bidding capability to the adapter for interstitial and rewarded ads.
Version 3.3.10.0
- Verified compatibility with AdColony SDK version 3.3.10.
Version 3.3.9.0
- Verified compatibility with AdColony SDK version 3.3.9.
- Removed
setGdprRequired()
andsetGdprConsentString()
methods onAdColonyBundleBuilder
. - Added the
AdColonyMediationAdapter.getAppOptions()
method. Publishers must now pass GDPR information to AdColony's SDK through these options. See the developer documentation for more details.
Version 3.3.8.1
- Updated adapter to support new open-beta Rewarded API.
- Updated the minimum required Google Mobile Ads SDK version to 17.2.0.
Version 3.3.8.0
- Verified compatibility with AdColony SDK version 3.3.8.
Version 3.3.7.0
- Verified compatibility with AdColony SDK version 3.3.7.
Version 3.3.6.0
- Verified compatibility with AdColony SDK version 3.3.6.
Version 3.3.5.1
- Updated the adapter to invoke the
onRewardedVideoComplete()
ad event.
Version 3.3.5.0
- Verified compatibility with AdColony SDK version 3.3.5.
Version 3.3.4.0
- Verified compatibility with AdColony SDK version 3.3.4.
- Updated the adapter with GDPR.
Version 3.3.3.0
- Verified compatibility with AdColony SDK version 3.3.3.
- Removed the
setTestModeEnabled
method from the Bundle builder class. Publishers can now request test ads from AdColony by specifying a test device viaaddTestDevice()
method from the AdRequest builder class.
Version 3.3.2.0
- Verified compatibility with AdColony SDK version 3.3.2.
Version 3.3.0.1
- Fixed an issue where the adapter fails to fill when the adapter is reinitialized.
- Fixed an issue where reward callback is sent incorrectly.
Version 3.3.0.0
- Verified compatibility with AdColony SDK version 3.3.0.
- Updated the Adapter project for Android Studio 3.0.
Version 3.2.1.1
- Added
setTestModeEnabled
method to the Bundle builder class. Publishers can use this method to mark AdColony requests as test requests.
Version 3.2.1.0
- Verified compatibility with AdColony SDK version 3.2.1.
Version 3.2.0.0
- Verified compatibility with AdColony SDK version 3.2.0.
Version 3.1.2.0
- Fixed possible NullPointerExceptions.
- Verified compatibility with AdColony SDK version 3.1.2.
Version 3.1.1.0
- Verified compatibility with AdColony SDK version 3.1.1.
Version 3.1.0.0
- Verified compatibility with AdColony SDK version 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
- Supports rewarded video and interstitial ads.