PremiumAds Google Ad Manager Mediation Adapter
Integrate PremiumAds as a mediation ad source in your Google Ad Manager app.
Supported formats: Banner, Interstitial, Rewarded, Native, App Open
The same adapter SDK works for both AdMob and Ad Manager. The integration steps below are specific to Google Ad Manager.
Android
Prerequisites
- Google Mobile Ads SDK 22.2.0+ (23.6.0+ recommended; 22.x support requires adapter 1.0.11+)
- Google Mobile Ads SDK 25.5.0+ requires your app to build with Kotlin 2.3+ (the SDK ships Kotlin 2.3 metadata)
minSdk21+,compileSdk34+
1. Add Repository & Dependency
settings.gradle.kts:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url = uri("https://repo.premiumads.net/artifactory/mobile-ads-sdk/") }
}
}
app/build.gradle.kts:
dependencies {
implementation("com.google.android.gms:play-services-ads:23.6.0")
implementation("net.premiumads.sdk:admob-adapter-v2:1.0.12")
}
Groovy (build.gradle)
// settings.gradle
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
repositories {
google()
mavenCentral()
maven { url "https://repo.premiumads.net/artifactory/mobile-ads-sdk/" }
}
}
// app/build.gradle
dependencies {
implementation 'com.google.android.gms:play-services-ads:23.6.0'
implementation 'net.premiumads.sdk:admob-adapter-v2:1.0.12'
}
2. Configure Ad Manager Custom Event
In the Ad Manager console, create a Yield Group with a custom event:
| Field | Value |
|---|---|
| Class Name | net.premiumads.sdk.adapter.PremiumAdsAdapter |
| Parameter | Your PremiumAds ad unit ID |
All ad formats use the same class name. The adapter auto-detects the format.
3. Load Ads
Use Google Ad Manager SDK APIs with AdManagerAdRequest:
import com.google.android.gms.ads.admanager.AdManagerAdRequest
import com.google.android.gms.ads.admanager.AdManagerAdView
// Initialize
MobileAds.initialize(this) { }
// Banner (Ad Manager)
val adView = AdManagerAdView(this)
adView.adUnitId = "/your-network-id/ad-unit"
adView.setAdSize(AdSize.BANNER)
adView.loadAd(AdManagerAdRequest.Builder().build())
// Interstitial
InterstitialAd.load(this, "/your-network-id/ad-unit",
AdManagerAdRequest.Builder().build(),
object : InterstitialAdLoadCallback() {
override fun onAdLoaded(ad: InterstitialAd) {
ad.show(this@MainActivity)
}
})
// Rewarded
RewardedAd.load(this, "/your-network-id/ad-unit",
AdManagerAdRequest.Builder().build(),
object : RewardedAdLoadCallback() {
override fun onAdLoaded(ad: RewardedAd) {
ad.show(this@MainActivity) { reward ->
Log.d("Ads", "Earned: ${reward.amount} ${reward.type}")
}
}
})
// Rewarded Interstitial
RewardedInterstitialAd.load(this, "/your-network-id/ad-unit",
AdManagerAdRequest.Builder().build(),
object : RewardedInterstitialAdLoadCallback() {
override fun onAdLoaded(ad: RewardedInterstitialAd) {
ad.show(this@MainActivity) { reward ->
Log.d("Ads", "Earned: ${reward.amount} ${reward.type}")
}
}
})
// Native
val adLoader = AdLoader.Builder(this, "/your-network-id/ad-unit")
.forNativeAd { ad -> /* display in NativeAdView */ }
.build()
adLoader.loadAd(AdManagerAdRequest.Builder().build())
// App Open
AppOpenAd.load(this, "/your-network-id/ad-unit",
AdManagerAdRequest.Builder().build(),
object : AppOpenAd.AppOpenAdLoadCallback() {
override fun onAdLoaded(ad: AppOpenAd) {
ad.show(this@MainActivity)
}
})
4. GDPR Compliance
The adapter automatically reads IAB TCF v2.0 consent from SharedPreferences. If you use Google's UMP SDK, no extra code is needed.
5. Debug Logging
PremiumAdsAdapter.setDebug(true)
Filter Logcat with tag PremiumAdsAdapter:
D/PremiumAdsAdapter: [Banner] Loading ad with unit: 6677029
D/PremiumAdsAdapter: [Banner] Ad loaded successfully
D/PremiumAdsAdapter: [Banner] Impression recorded
6. ProGuard
No additional ProGuard rules needed — the adapter includes its own consumer rules.
iOS
Prerequisites
- Google Mobile Ads SDK 11.0+ (supports up to v13)
- Xcode 15+, iOS 13.0+
CocoaPods (Preferred)
pod 'PremiumAdsGoogleAdapter'
Swift Package Manager
- File → Add Packages
- Enter:
https://github.com/premium-ads/adapter-ios-spm-v2 - Set Dependency Rule to "Up to Next Major Version" from
1.0.4
Configure Ad Manager Custom Event
| Field | Value |
|---|---|
| Class Name | PremiumAdsAdapter |
| Parameter | Your PremiumAds ad unit ID |