Install the AdMob Adapter SDK
Install the RevenueCat AdMob adapter for iOS or Android with the legacy or Next-Gen Google Mobile Ads SDK
This tutorial shows you how to install the RevenueCat AdMob adapter for iOS or Android. By the end, your app will be ready to track AdMob events automatically with the adapter that matches its Google Mobile Ads SDK generation.
This feature is currently in beta.
On Android, install either the legacy adapter or the Next-Gen adapter. Choose the adapter that matches the Google Mobile Ads SDK your app uses. The two adapters are mutually exclusive.
Prerequisites
Enable Impression-level ad revenue in your AdMob account before integrating the adapter. Follow Google's guide to turn on impression-level ad revenue.
- iOS
- Android (Legacy AdMob)
- Android (Next-Gen AdMob)
- Minimum iOS version: iOS 15.0+
- RevenueCat SDK:
purchases-ios5.89.0+ - AdMob SDK: Google Mobile Ads SDK 12.0.0+
- Swift only: This adapter does not expose Objective-C entrypoints. Use RevenueCat's base
AdTrackerAPIs directly for Objective-C integrations.
- RevenueCat SDK:
purchases-android10.19.0+ - AdMob SDK: Google Mobile Ads SDK 22.0.0+
- Minimum Android version: API level 24+
- Compile SDK: 35+
- Kotlin: 1.9+
- RevenueCat SDK:
purchases-android10.23.0+ - AdMob SDK: Google Mobile Ads Next-Gen SDK 1.3.0+
- Kotlin only: The adapter helpers aren't available from Java. Java apps can use the base
AdTrackerAPIs directly.
1. Install the adapter
- iOS
- Android (Legacy AdMob)
- Android (Next-Gen AdMob)
Add the AdMob adapter package via Swift Package Manager:
.package(url: "https://github.com/RevenueCat/purchases-ios-admob", from: "5.89.0")
Then add the RevenueCatAdMob product to your target.
If your project depends on RevenueCat via SPM, use the purchases-ios-spm package (not purchases-ios). The adapter declares this dependency correctly, but if you add RevenueCat separately, make sure both resolve from the same purchases-ios-spm repository to avoid duplicate package errors.
Add the AdMob adapter module to your app's build.gradle:
dependencies {
implementation 'com.revenuecat.purchases:purchases-admob:10.19.0+'
}
This module depends on the RevenueCat Purchases SDK and Google Mobile Ads SDK.
Remove purchases-admob and com.google.android.gms:play-services-ads before installing the Next-Gen adapter. The legacy and Next-Gen adapters can't coexist in the same app.
Add RevenueCat, the Next-Gen adapter, and Google Mobile Ads Next-Gen to your app module's build.gradle.kts:
val revenueCatVersion = "10.23.0"
dependencies {
implementation("com.revenuecat.purchases:purchases:$revenueCatVersion")
implementation("com.revenuecat.purchases:purchases-admob-next-gen:$revenueCatVersion")
implementation("com.google.android.libraries.ads.mobile.sdk:ads-mobile-sdk:1.4.0")
}
The adapter doesn't select a Google Mobile Ads Next-Gen version transitively. Your app owns this dependency, and the explicit version keeps builds reproducible.
Mediation adapters can bring legacy Google Mobile Ads artifacts back into the dependency graph. Exclude both legacy artifacts globally in build.gradle.kts to prevent duplicate-symbol build failures:
configurations.configureEach {
exclude(group = "com.google.android.gms", module = "play-services-ads")
exclude(group = "com.google.android.gms", module = "play-services-ads-lite")
}
Follow Google's Next-Gen migration guide for additional mediation-specific requirements.
Next steps
Once the adapter is installed, follow the integration guide: