This guide shows you how to use GMA Next-Gen SDK to load and display ads from AppLovin using AdMob Mediation covering both waterfall and bidding integrations. It covers how to add AppLovin to an ad unit's mediation configuration, and how to integrate the AppLovin SDK and adapter into an Android app.
Supported integrations and ad formats
The mediation adapter for AppLovin has the following capabilities:
| Integration | |
|---|---|
| Bidding | |
| Waterfall | |
| Formats | |
| App Open | 1 |
| Banner | 2 |
| Interstitial | |
| Rewarded | |
| Native | |
1 App Open ad format is only available for waterfall integrations.
Waterfall supports only 320x50 and 728x90 banner sizes. Bidding doesn't support banner ads.
Requirements
- Android API level 24 or higher
- [For bidding]: To integrate all supported ad formats in bidding, use the AppLovin adapter 9.4.2.0 or higher (latest version recommended).
Latest GMA Next-Gen SDK
Complete the mediation Get started guide
Step 1: Set up configurations in AppLovin UI
Sign up or log in to your AppLovin account.
To set up your AdMob ad unit, you'll need your AppLovin SDK Key and Report Key. To find them, go to the AppLovin UI > Account > Keys to see both values.

If you plan on just integrating bidding, you can proceed to configure your mediation settings.
Select app for mediation
Bidding
This step isn't required for bidding integrations.
Waterfall
On the AppLovin UI, select Applications under the Monetization section to get to your registered apps. Select the app you'd like to use with mediation from the list of available apps.

Create a zone
Bidding
This step isn't required for bidding integrations.
Waterfall
On the AppLovin UI, select Zones under the Monetization section to get to your registered zone IDs. If you have already created the required zones for your app, skip ahead to Step 2. To create a new zone ID, click Create Zone.

Enter the name of Zone ID, select Android as the Platform, and choose the Ad Type.
Configure Pricing for the zone by selecting either Flat CPM or Optimized by AppLovin. CPMs can be configured on a per country basis for the Flat CPM option. Then, click Save.

Once the zone is created, the zone ID can be found under the Zone ID column.

Update your app-ads.txt
Authorized Sellers for Apps app-ads.txt is an IAB Tech Lab initiative that helps ensure your
app ad inventory is only sold through channels you've identified as authorized. To prevent a
significant loss in ad revenue, you'll need to implement an app-ads.txt file.
If you haven't done so already,
set up an app-ads.txt file for your app.
To implement app-ads.txt for AppLovin,
Add AppLovin to your app-ads.txt file.
Turn on test mode
Follow the instructions in AppLovin's MAX Test Mode guide on how to enable AppLovin test ads.
Step 2: Set up AppLovin demand in AdMob UI
Configure mediation settings for your ad unit
You need to add AppLovin to the mediation configuration for your ad unit.
First, sign in to your AdMob account. Next, 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 AppLovin as an ad source.
To create a new mediation group, select Create Mediation Group.

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, and then click Add Ad Units.

Associate this mediation group with one or more of your existing AdMob ad units. Then click Done.

You should now see the ad units card populated with the ad units you selected:

Add AppLovin as an ad source
Bidding
Under the Bidding card in the Ad Sources section, select Add ad source. Then select AppLovin .
Click How to sign a partnership agreement and set up a bidding partnership with AppLovin.
Click Acknowledge & agree, then click Continue.
If you already have a mapping for AppLovin, you can select it. Otherwise, click Add mapping.
Next, enter the SDK Key obtained in the previous section. Then click Done.

Waterfall
Under the Waterfall card in the Ad Sources section, select Add Ad Source.
Select AppLovin and enable the Optimize switch. Enter the Report Key obtained in the previous section to set up ad source optimization for AppLovin. Then enter an eCPM value for AppLovin and click Continue.

If you already have a mapping for AppLovin, you can select it. Otherwise, click Add mapping.

Next, enter the Bundle ID of your app along with the SDK Key and the Zone ID obtained in the previous section. Then click Done.

Add AppLovin Corp. to GDPR and US state regulations ad partners list
Follow the steps in European regulations settings and US state regulations settings to add AppLovin Corp. to the European and US state regulations ad partners list in the AdMob UI.
Step 3: Import the AppLovin SDK and adapter
Android Studio integration (recommended)
In your app-level gradle file, add the following implementation dependencies and configurations:
Kotlin
dependencies { implementation("com.google.android.libraries.ads.mobile.sdk:ads-mobile-sdk:0.24.0-beta02") implementation("com.google.ads.mediation:applovin:13.5.1.0") } configurations.configureEach { exclude(group = "com.google.android.gms", module = "play-services-ads") exclude(group = "com.google.android.gms", module = "play-services-ads-lite") }
Groovy
dependencies { implementation 'com.google.android.libraries.ads.mobile.sdk:ads-mobile-sdk:0.24.0-beta02' implementation 'com.google.ads.mediation:applovin:13.5.1.0' } configurations.configureEach { exclude group: 'com.google.android.gms', module: 'play-services-ads' exclude group: 'com.google.android.gms', module: 'play-services-ads-lite' }
Manual integration
Download the AppLovin Android SDK, extract the
applovin-sdk-x.y.z.jar, and add it to your project.Navigate to the AppLovin adapter artifacts on Google's Maven Repository. Select the latest version, download the AppLovin adapter's .aar file, and add it to your project.
Step 4: Implement privacy settings on AppLovin SDK
EU Consent and GDPR
To comply with Google EU User Consent Policy, you must make certain disclosures to your users in the European Economic Area (EEA), the UK, and Switzerland, and obtain their consent for the use of cookies or other local storage where legally required, and for the collection, sharing, and use of personal data for ads personalization. This policy reflects the requirements of the EU ePrivacy Directive and the General Data Protection Regulation (GDPR). You are responsible for verifying consent is propagated to each ad source in your mediation chain. Google is unable to pass the user's consent choice to such networks automatically.
Since SDK version 12.0.0, AppLovin supports reading the consent string from shared preferences and setting the consent status accordingly.
If you are not using AppLovin SDK version 12.0.0+ or not using a CMP that writes
the consent string into the
shared preferences
, you can use the setHasUserConsent method. The
following example passes consent information to the AppLovin SDK. You must set
these options before you initialize GMA Next-Gen SDK to ensure they
get forwarded properly to the AppLovin SDK.
Java
AppLovinPrivacySettings.setHasUserConsent(true);
Kotlin
AppLovinPrivacySettings.setHasUserConsent(true)
See AppLovin's privacy settings for more information.
Declare child users
Starting from AppLovin SDK 13.0.0, AppLovin no longer supports age-restricted user flags and you may not initialize or use the AppLovin SDK in connection with a "child" as defined under applicable laws. For more information, see AppLovin's documentation on Prohibition on Children Data or Using the Services for Children or Apps Exclusively Targeted to Children .
AppLovin adapter version 13.0.0.1 or higher disables AppLovin mediation automatically for apps that declare either of the following settings with the GMA Next-Gen SDK:
US states privacy laws
US 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 through a prominent "Do Not Sell My Personal Information" link on the "selling" party's homepage. The US 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 AppLovin SDK includes the setDoNotSell method to let publishers opt out of
the sale of personal information.
The following example passes this consent information to the AppLovin SDK. You must set these options before you initialize GMA Next-Gen SDK to ensure they get forwarded properly to the AppLovin SDK.
Java
AppLovinPrivacySettings.setDoNotSell(true);
Kotlin
AppLovinPrivacySettings.setDoNotSell(true)
See AppLovin's Privacy documentation for more information.
Step 5: Add required code
No additional code is required for AppLovin integration.
Step 6: Test your implementation
Enable test ads
Make sure you register your test device for AdMob and enable test mode in AppLovin UI.
Verify test ads
To verify that you are receiving test ads from AppLovin, enable single ad source testing in ad inspector using the AppLovin (Bidding) and AppLovin (Waterfall) ad source(s).
Optional steps
Network-specific parameters
The AppLovin adapter supports setMuteAudio() which can disable audio on video
ads. This method can be called from an AppLovinExtras.Builder() object:
Java
Bundle extras = new AppLovinExtras.Builder()
.setMuteAudio(true)
.build();
AdRequest request = new AdRequest.Builder(AD_UNIT_ID)
.putAdSourceExtrasBundle(ApplovinAdapter.class, extras)
.build();
Kotlin
val extras = AppLovinExtras.Builder()
.setMuteAudio(true)
.build()
val request = AdRequest.Builder(AD_UNIT_ID)
.putAdSourceExtrasBundle(ApplovinAdapter::class.java, extras)
.build()
Optimizations
Initialize the AppLovin SDK when your app launches. This allows AppLovin to start tracking events immediately."Error codes
If the adapter fails to receive an ad from AppLovin, publishers can check the
underlying error from the ad response using
ResponseInfo.getAdSourceResponses()
under the following classes:
com.google.ads.mediation.applovin.ApplovinAdapter
com.google.ads.mediation.applovin.AppLovinMediationAdapter
Here are the codes and accompanying messages thrown by the AppLovin adapter when an ad fails to load:
| Error code | Reason |
|---|---|
| -1009 to -1, 204 | AppLovin SDK returned an error. See AppLovin's documentation for more details. |
| 101 | The requested ad size does not match an AppLovin supported banner size. |
| 103 | Context is null. |
| 104 | AppLovin bid token is empty. |
| 105 | Requested multiple ads for the same zone. AppLovin can only load 1 ad at a time per zone. |
| 106 | Ad is not ready to display. |
| 108 | AppLovin Adapter does not support the ad format being requested. |
| 109 | Context is not an Activity instance. |
| 110 | SDK key is missing. |
| 112 | User is a child. |
| 113 | Ad unit ID is missing. |