Integrating AppLovin with Mediation

This guide is intended for publishers who want to use the Google Mobile Ads SDK to load and display ads from AppLovin Ads via mediation. 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 ad formats and features

The Ad Manager mediation adapter for AppLovin has the following capabilities:

Formats
Banners
Interstitials
Rewarded Video
Rewarded Video (new APIs)
Native Ads - Custom Rendering
Features
Smart Banners
Automatic Data Collection

Requirements

  • Android API level 16 or higher
  • Latest Google Mobile Ads SDK

Step 1: Set up AppLovin

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 Dashboard and click on the Account tab. In the dropdown list under Account, select Keys to see both values.

Select app for mediation

On the AppLovin dashboard, 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 Zone

On the AppLovin dashboard, 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 Step2. To create a new Zone ID, click Create Zone.

Enter the name of Zone ID, select Android as the Platform, and choose the desired 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.

Step 2: Configure mediation settings for your Ad Manager ad unit

Sign in to your Ad Manager account. Navigate to Delivery > Yield groups and click the New yield group button.

Enter a unique Name for your yield group, set the Status to Active, select your Ad Format, and set the Inventory type to Mobile App. Under the Targeting > Inventory section, select the Ad Unit ID to which you want to add mediation.

Next, click the Add yield partner button.

If you already have a Yield partner for AppLovin, you can simply select it. Otherwise, select Create a new yield partner.

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

Once the Yield partner is selected, choose Mobile SDK mediation as the Integration type, Android as the Platform, and Active as the Status. Enter the Application ID of your app along with the Zone ID and the SDK Key obtained in the previous section and a Default CPM value.

Click Save at the bottom of the page when done.

Using rewarded video ads

In the settings for your rewarded video ad unit, provide values for the reward amount and reward type. Then, to ensure you provide the same reward to the user no matter which ad network is served, check the Override reward settings from third-party ad networks when using mediation box.

If you don't apply this setting, the AppLovin adapter passes back the reward specified in the AppLovin dashboard when creating the placement.

Step 3: Import the AppLovin SDK and adapter

Add the following implementation dependency with the latest version of the AppLovin SDK and adapter in the app-level build.gradle file:

repositories {
    jcenter()
}

...
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'com.google.android.gms:play-services-ads:19.2.0'
    implementation 'com.google.ads.mediation:applovin:9.12.8.0'
}
...

Manual integration

  • Download the AppLovin Android SDK, extract the applovin-sdk-x.y.z.jar, and add it to your project.

  • Download the latest AppLovin adapter .aar file from Bintray and add it to your project.

Step 4: Additional code required

No additional code required.

Step 5: Test your implementation

AppLovin recommends that test ads should be used during development if you cannot get live ads.

To enable test ads, go to the Manage Apps page by clicking on your app's name in the AppLovin dashboard and navigate to the Test Mode section. Toggle the Test Mode switch to ON.

Test Mode may take up to 30 mins to take effect. It will also automatically reset to OFF after two hours.

Optional steps

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 section below shows you how to enable or disable personalized ads for AppLovin.

In SDK version 8.0.1, AppLovin added the setHasUserContent and setIsAgeRestrictedUser methods. The following sample code shows how to pass consent information to the AppLovin SDK. It is recommended that you call these methods prior to requesting ads via the Google Mobile Ads SDK.

Java

import com.applovin.sdk.AppLovinPrivacySettings;
// ...

AppLovinPrivacySettings.setHasUserConsent(true, context);

Kotlin

import com.applovin.sdk.AppLovinPrivacySettings
// ...

AppLovinPrivacySettings.setHasUserConsent(true, context)

Additionally, if the user is known to be in an age-restricted category, you can also set the below flag to true.

Java

AppLovinPrivacySettings.setIsAgeRestrictedUser(true, context);

Kotlin

AppLovinPrivacySettings.setIsAgeRestrictedUser(true, context)

See AppLovin's privacy settings for more details.

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();
PublisherAdRequest request = new PublisherAdRequest.Builder()
   .addNetworkExtrasBundle(ApplovinAdapter.class, extras)
   .build();

Kotlin

val extras = AppLovinExtras.Builder()
   .setMuteAudio(true)
   .build()
val request = PublisherAdRequest.Builder()
   .addNetworkExtrasBundle(ApplovinAdapter::class.java, extras)
   .build()

Optimizations

Initializing the AppLovin SDK as soon as your application launches provides AppLovin the ability to track events as soon as the app starts.

Java

AppLovinSdk.getInstance("sdkKey", null, context).initializeSdk();

Kotlin

AppLovinSdk.getInstance("sdkKey", null, context).initializeSdk()

AppLovin Android Mediation Adapter Changelog

Next Version

  • Adapter now throws an error if multiple interstitial ads are requested using the same Zone ID.

Version 9.13.0.0

  • Updated the adapter to support inline adaptive banner requests.
  • Verified compatibility with AppLovin SDK 9.13.0.
  • 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.
  • AppLovin SDK version 9.13.0.

Version 9.12.8.0

  • Verified compatibility with AppLovin SDK 9.12.8.

Built and tested with:

  • Google Mobile Ads SDK version 19.1.0.
  • AppLovin SDK version 9.12.8.

Version 9.12.7.0

  • Verified compatibility with AppLovin SDK 9.12.7.

Built and tested with:

  • Google Mobile Ads SDK version 19.1.0.
  • AppLovin SDK version 9.12.7.

Version 9.12.6.1

  • Fixed bug introduced in 9.11.4.1 where open bidding banner ads timeout.

Built and tested with:

  • Google Mobile Ads SDK version 19.1.0.
  • AppLovin SDK version 9.12.6.

Version 9.12.6.0

  • Verified compatibility with AppLovin SDK 9.12.6.

Built and tested with:

  • Google Mobile Ads SDK version 19.1.0.
  • AppLovin SDK version 9.12.6.

Version 9.12.5.0

  • Verified compatibility with AppLovin SDK 9.12.5.

Built and tested with:

  • Google Mobile Ads SDK version 19.1.0.
  • AppLovin SDK version 9.12.5.

Version 9.12.4.0

  • Verified compatibility with AppLovin SDK 9.12.4.
  • Adapter now requires an Activity context to initialize and load ads from AppLovin.

Built and tested with:

  • Google Mobile Ads SDK version 19.1.0.
  • AppLovin SDK version 9.12.4.

Version 9.12.3.0

  • Verified compatibility with AppLovin SDK 9.12.3.

Built and tested with:

  • Google Mobile Ads SDK version 19.1.0.
  • AppLovin SDK version 9.12.3.

Version 9.12.2.0

  • Verified compatibility with AppLovin SDK 9.12.2.

Built and tested with:

  • Google Mobile Ads SDK version 19.1.0.
  • AppLovin SDK version 9.12.2.

Version 9.12.1.0

  • Verified compatibility with AppLovin SDK 9.12.1.
  • Updated the minimum required Google Mobile Ads SDK version to 19.1.0.

Built and tested with:

  • Google Mobile Ads SDK version 19.1.0.
  • AppLovin SDK version 9.12.1.

Version 9.12.0.0

  • Verified compatibility with AppLovin SDK 9.12.0.

Built and tested with:

  • Google Mobile Ads SDK version 19.0.1.
  • AppLovin SDK version 9.12.0.

Version 9.11.4.1

  • Fixed an issue that may cause open bidding banner/interstitial ad requests to timeout.
  • 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.
  • AppLovin SDK version 9.11.4.

Version 9.11.4.0

  • Verified compatibility with AppLovin SDK 9.11.4.

Built and tested with:

  • Google Mobile Ads SDK version 18.3.0.
  • AppLovin SDK version 9.11.4.

Version 9.11.2.0

  • Verified compatibility with AppLovin SDK 9.11.2.

Built and tested with:

  • Google Mobile Ads SDK version 18.3.0.
  • AppLovin SDK version 9.11.2.

Version 9.11.1.0

  • Verified compatibility with AppLovin SDK 9.11.1.

Built and tested with:

  • Google Mobile Ads SDK version 18.3.0.
  • AppLovin SDK version 9.11.1.

Version 9.10.5.0

  • Verified compatibility with AppLovin SDK 9.10.5.

Built and tested with:

  • Google Mobile Ads SDK version 18.3.0.
  • AppLovin SDK version 9.10.5.

Version 9.9.1.2

  • Removed all references to AppLovin placement ID.
  • 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.
  • AppLovin SDK version 9.9.1.

Version 9.9.1.1

  • Native ads now leverage the unified native ads mediation API.

Built and tested with:

  • Google Mobile Ads SDK version 18.2.0.
  • AppLovin SDK version 9.9.1.

Version 9.9.1.0

  • Verified compatibility with AppLovin SDK 9.9.1.
  • Updated the minimum required Google Mobile Ads SDK version to 18.2.0.

Version 9.8.0.0

  • Verified compatibility with AppLovin SDK 9.8.0.
  • Updated the minimum required Google Mobile Ads SDK version to 18.1.1.

Version 9.7.2.0

  • Verified compatibility with AppLovin SDK 9.7.2.
  • Updated the minimum required Google Mobile Ads SDK version to 18.1.0.

Version 9.4.2.0

  • Added open bidding capability to the adapter for banner, interstitial and rewarded ads.
  • Added support for flexible banner ad sizes.
  • Verified compatibility with AppLovin SDK 9.4.2.

Version 9.2.1.1

  • Updated adapter to support new open-beta Rewarded API.
  • Updated the minimum required Google Mobile Ads SDK version to 17.2.0.

Version 9.2.1.0

  • Verified compatibility with AppLovin SDK 9.2.1

Version 9.1.3.0

  • Removed support for placements as they were deprecated by AppLovin SDK.
  • Verified compatibility with AppLovin SDK 9.1.3

Version 9.1.0.0

  • Verified compatibility with AppLovin SDK 9.1.0

Version 8.1.4.0

  • Verified compatibility with AppLovin SDK 8.1.4

Version 8.1.3.0

  • Verified compatibility with AppLovin SDK 8.1.3

Version 8.1.0.0

  • Verified compatibility with AppLovin SDK 8.1.0

Version 8.0.2.1

  • Updated the adapter to invoke the onRewardedVideoComplete() ad event.

Version 8.0.2.0

  • Verified compatibility with AppLovin SDK 8.0.2

Version 8.0.1.1

  • Added support for native ads.
  • Set AdMob as mediation provider on the AppLovin SDK.

Version 8.0.1.0

  • Verified compatibility with AppLovin SDK 8.0.1

Version 8.0.0.0

  • Verified compatibility with AppLovin SDK 8.0.0

Version 7.8.6.0

  • Verified compatibility with AppLovin SDK 7.8.6

Version 7.8.5.0

  • Added support for zones and smart banners.
  • Verified compatibility with AppLovin SDK 7.8.5.

Version 7.7.0.0

  • Verified compatibility with AppLovin SDK 7.7.0.

Version 7.6.2.0

  • Verified compatibility with AppLovin SDK 7.6.2.

Version 7.6.1.0

  • Verified compatibility with AppLovin SDK 7.6.1.

Version 7.6.0.0

  • Verified compatibility with AppLovin SDK 7.6.0.

Version 7.5.0.0

  • Verified compatibility with AppLovin SDK 7.5.0.

Version 7.4.1.1

  • Added support for banner ads.

Version 7.4.1.0

  • Verified compatibility with AppLovin SDK 7.4.1.

Version 7.3.2.0

  • Added support for interstitial ads.

Earlier versions

  • Added support for rewarded video ads.