Integrating AppLovin with Mediation

This guide is for publishers who want to use the Google Mobile Ads SDK to load and display ads from AppLovin via mediation. It covers how to integrate the AppLovin SDK and adapter into a Unity app.

Supported formats and features

Formats
Banners
Interstitials
Rewarded video
Features
Smart banners
Ad Network Optimization

Requirements

  • Unity 4 or higher
  • To deploy on Android:
    • Android API Level 14 or later
    • Google Play services 9.0.0 or later
  • To deploy on iOS
    • Xcode 7.0 or higher
    • iOS Deployment target of 7.0 or higher
    • Minimum required Google Mobile Ads SDK 7.14.0
  • A working Unity project configured with Google Mobile Ads SDK. See Get Started for details.

Step 1: Set up AppLovin

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

Manage Apps

On the AppLovin dashboard, select Manage Apps under the Monetize section to get to your registered apps. Select the app you'd like to use with mediation from the list of available apps. If you do not see your app in the list, it is not registered. See the note below to get it registered.

If you haven't yet registered your app with AppLovin, you need to do so before setting up AdMob mediation. AppLovin's registration is an automatic process that detects apps that initialize the AppLovin SDK. If your app supports Android and iOS, you need to initialize the SDK on both.

First, follow the steps under the Import the Applovin SDK and adapter section of this guide, then complete the following instructions for the platform you're building for:

Instructions
Android

Uncomment the following meta-data tag in your AndroidManifest.xml file in the Assets/Plugins/Android/GoogleMobileAdsAppLovinMediation directory and set the AppLovin SDK key obtained in the previous section as the value:

<meta-data android:name="applovin.sdk.key"
    android:value="YOUR_SDK_KEY_HERE" />
iOS

Add the AppLovin SDK key obtained earlier to the AppLovinPostProcessBuild.cs file under the Assets/GoogleMobileAds/Editor/ directory as shown below.

...
rootDict.SetString("AppLovinSdkKey",
                   "YOUR_SDK_KEY_HERE");
...

Then call the AdMob Unity adapter's AppLovin.Initialize() method at the start of your Unity app.

Once the registration process is complete, you can optionally remove the Initialize() call.

Create Zone

On the AppLovin dashboard, select Zones under the Monetize 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.

Choose your platform to create a Zone.

Android

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.

iOS

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

Android

iOS

Step 2: Configure AdMob ad unit

You need to add AppLovin to the mediation configuration for your AdMob ad units. First, sign in to your AdMob account.

If you're deploying your Unity app to both Android and iOS, you need two AdMob ad units, one for each platform.

Android

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.

AdMob mediation tab

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. Then click Add Ad Units.

New mediation group 2

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

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

Mediation group ad units

Add AppLovin as an ad source

In the Ad Sources card, select Add Ad Network.

Select AppLovin and enable the Optimize switch. Enter the Report Key obtained in the previous section to set up ANO for AppLovin. Then enter an eCPM value for AppLovin and click Continue.

Enter the Application ID of your app along with the Zone ID and the SDK Key obtained in the previous section.

iOS

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. Then click Add Ad Units.

Associate this mediation group with one or more of your existing 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

In the Ad Sources card, select Add Ad Network.

Select AppLovin and enable the Optimize switch. Enter the Report Key obtained in the previous section to set up ANO for AppLovin. Then enter an eCPM value for AppLovin and click Continue.

Enter the Bundle ID of your app along with the Zone ID and the SDK Key obtained in the previous section.

Using rewarded video ads

In the settings for your rewarded video ad unit, check the Override reward settings from third-party ad networks when using AdMob mediation checkbox so that you provide the same reward to the user no matter which ad network is served.

If you don't override the reward, the AppLovin adapter passes back the reward specified in the AppLovin dashboard when creating the Zone.

For more information on setting reward values for AdMob ad units, see Create an ad unit.

Step 3: Import the AppLovin SDK and adapter

Download the latest version of Google Mobile Ads mediation plugin for AppLovin and extract the GoogleMobileAdsAppLovinMediation.unitypackagefrom the zip file.

In your Unity project editor, select Assets > Import Package > Custom Package and find the GoogleMobileAdsAppLovinMediation.unitypackage file you downloaded. Make sure that all the files are selected and click Import.

Step 4: Additional code required

No additional code is required for AppLovin integration.

Step 5: Test your implementation

AppLovin recommends that test ads 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 minutes 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.

The Google Mobile Ads mediation plugin for AppLovin version 3.0.1 includes the AppLovin.SetHasUserConsent() and AppLovin.SetIsAgeRestrictedUser() methods. The following sample code shows how to pass consent information to the AppLovin SDK. If you choose to call this method, it is recommended that you do so prior to requesting ads via the Google Mobile Ads SDK.

using GoogleMobileAds.Api.Mediation.AppLovin;
// ...

AppLovin.SetHasUserConsent(true);

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

AppLovin.SetIsAgeRestrictedUser(true);

See AppLovin's Frequently Asked Questions for GDPR for more details.

Optimizations

Adding a call to AppLovin.Initialize() to your launch activity provides AppLovin the ability to track events as soon as the app starts.

Send feedback about...

Google Mobile Ads SDK for Unity
Google Mobile Ads SDK for Unity
Need help? Visit our support page.