This guide shows you how to use GMA Next-Gen SDK to load and display ads from AppLovin using 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 Ad Manager 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,
create an app-ads.txt file for Ad Manager.
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 Ad Manager UI
Sign in to your Ad Manager account.
Add AppLovin in Companies
Bidding
This step isn't required for bidding integrations.
Waterfall
Navigate to Admin > Companies, then click the New company button in the All companies tab. Select Ad network.

Select AppLovin as the Ad network, enter a unique Name and enable Mediation. Turn on Automatic data collection, and enter the Report Key obtained in the previous section.
You don't need to enter a Username or Password. Click Save when done.

Enable secure signal sharing
Bidding
Navigate to Admin > Global settings. Go to the Ad Exchange account settings tab and review and toggle on Secure signal sharing. Click Save.

Waterfall
This step isn't required for waterfall integrations.
Share secure signal on bid requests
Bidding
Navigate to Inventory > Secure Signals. Under Secure signals, search for AppLovin Corp. and toggle on Enable app integration.

Click Save.
Waterfall
This step isn't required for waterfall integrations.
Allow secure signal sharing for SDK Bidding
Bidding
Navigate to Delivery > Demand channel settings. In the Default settings tab, toggle on Allow secure signal sharing for SDK Bidding.

Click Save.
Waterfall
This step isn't required for waterfall integrations.
Configure AppLovin bidding
Bidding
Navigate to Delivery > Bidders, and click Go to SDK Bidding.

Click New bidder.

Select AppLovin as the bidder.

Click Continue to enable SDK Bidding for this bidder.

Click Done.
Waterfall
This step isn't required for waterfall integrations.
Configure ad unit mapping
Bidding
Navigate to Delivery > Bidders, and click Go to SDK Bidding.

Select the company for AppLovin.

Go to the Ad unit mapping tab and click New ad unit mapping.

Choose Specific ad unit. Select an ad unit and format, Mobile app as the Inventory type, and your Mobile application. Then, enter SDK Key obtained in the previous section. Finally, click Save.

Waterfall
Navigate to Delivery > Yield groups and click the New yield group button. Select your Mobile application.

Scroll down and click Add yield partner.

Select the company you created for AppLovin in the previous section. Choose Mobile SDK mediation as the Integration type, Android as the Platform, and Active as the Status.
Enter the Bundle ID of your app along with the SDK Key and the Zone ID obtained in the previous section, and the Default CPM value. Click Save.

Note: Automatic data collection takes a few days to gather data before it can accurately calculate a Dynamic CPM value for a mediation network. Once the eCPM can be calculated, it is automatically updated on your behalf.
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 Ad Manager 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 Ad Manager 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. |