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 iOS 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

  • iOS deployment target of 9.0 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 iOS as the Platform, and desired Ad Type.

For Pricing, select either Flat CPM with the drop-down to select specific countries for CPM zones or Optimized by AppLovin for non CPM Zones. 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, iOS as the Platform, and Active as the Status. Enter the Bundle 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 line to your project's Podfile:

    pod 'GoogleMobileAdsMediationAppLovin'
    
  • From the command line run:

    pod install --repo-update

Manual integration

  • Download the latest version of the AppLovin iOS SDK and link ApplovinSDK.framework in your project.

  • Download the latest version of the ApplovinAdapter and link ApplovinAdapter.framework in your project.

  • Add the following frameworks to your project:

    • AdSupport
    • AVFoundation
    • CoreGraphics
    • CoreMedia
    • CoreTelephony
    • StoreKit
    • SystemConfiguration
    • UIKit
    • WebKit (NEW)
    • libz.tbd (NEW)

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 5.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.

Swift

import AppLovinSDK
// ...

ALPrivacySettings.setHasUserConsent(true)

Objective-C

#import <AppLovinSDK/AppLovinSDK.h>
// ...

[ALPrivacySettings setHasUserConsent:YES];

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

Swift

import AppLovinSDK
// ...

ALPrivacySettings.setIsAgeRestrictedUser(true)

Objective-C

#import <AppLovinSDK/AppLovinSDK.h>
// ...

[ALPrivacySettings setIsAgeRestrictedUser:YES];

See AppLovin's privacy settings for more details.

Network-specific parameters

The AppLovin adapter supports muteAudio, an optional extra to disable audio on video ads. This parameter can be passed to the adapter using the GADMAdapterAppLovinExtras class and must be set on every ad request. Here's how to set it:

Swift

let request = DFPRequest()
let extras = GADMAdapterAppLovinExtras()
extras.muteAudio = false
request.register(extras)

Objective-C

DFPRequest *request = [DFPRequest request];
GADMAdapterAppLovinExtras * extras = [[GADMAdapterAppLovinExtras alloc] init];
extras.muteAudio = NO;
[request registerAdNetworkExtras:extras];

Optimizations

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

Swift

let sdk = ALSdk.shared(withKey: "sdkKey")
sdk?.initializeSdk()

Objective-C

ALSdk *sdk = [ALSdk sharedWithKey:@"sdkKey"];
[sdk initializeSdk];

AppLovin iOS Mediation Adapter Changelog

Version 6.13.0.0

  • Verified compatibility with AppLovin SDK 6.13.0.
  • Now requires Google Mobile Ads SDK version 7.61.0 or higher.

Built and tested with:

  • Google Mobile Ads SDK version 7.61.0.
  • AppLovin SDK version 6.13.0.

Version 6.12.8.0

  • Verified compatibility with AppLovin SDK 6.12.8.

Built and tested with:

  • Google Mobile Ads SDK version 7.60.0.
  • AppLovin SDK version 6.12.8.

Version 6.12.7.0

  • Verified compatibility with AppLovin SDK 6.12.7.
  • Now requires Google Mobile Ads SDK version 7.60.0 or higher.

Built and tested with:

  • Google Mobile Ads SDK version 7.60.0.
  • AppLovin SDK version 6.12.7.

Version 6.12.6.0

  • Verified compatibility with AppLovin SDK 6.12.6.

Built and tested with:

  • Google Mobile Ads SDK version 7.59.0.
  • AppLovin SDK version 6.12.6.

Version 6.12.5.0

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

Built and tested with:

  • Google Mobile Ads SDK version 7.59.0.
  • AppLovin SDK version 6.12.5.

Version 6.12.4.0

  • Verified compatibility with AppLovin SDK 6.12.4.

Built and tested with:

  • Google Mobile Ads SDK version 7.58.0.
  • AppLovin SDK version 6.12.4.

Version 6.12.3.0

  • Verified compatibility with AppLovin SDK 6.12.3.

Built and tested with:

  • Google Mobile Ads SDK version 7.58.0.
  • AppLovin SDK version 6.12.3.

Version 6.12.2.0

  • Verified compatibility with AppLovin SDK 6.12.2.

Built and tested with:

  • Google Mobile Ads SDK version 7.58.0.
  • AppLovin SDK version 6.12.2.

Version 6.12.1.0

  • Verified compatibility with AppLovin SDK 6.12.1.

Built and tested with:

  • Google Mobile Ads SDK version 7.58.0.
  • AppLovin SDK version 6.12.1.

Version 6.12.0.0

  • Verified compatibility with AppLovin SDK 6.12.0.
  • Added standardized adapter error codes and messages.

Built and tested with:

  • Google Mobile Ads SDK version 7.58.0.
  • AppLovin SDK version 6.12.0.

Version 6.11.5.0

  • Verified compatibility with AppLovin SDK 6.11.5.
  • Removed support for the i386 architecture.

Built and tested with:

  • Google Mobile Ads SDK version 7.56.0.
  • AppLovin SDK version 6.11.5.

Version 6.11.4.0

  • Verified compatibility with AppLovin SDK 6.11.4.

Built and tested with:

  • Google Mobile Ads SDK version 7.55.1.
  • AppLovin SDK version 6.11.4.

Version 6.11.3.0

  • Verified compatibility with AppLovin SDK 6.11.3.

Built and tested with:

  • Google Mobile Ads SDK version 7.55.0.
  • AppLovin SDK version 6.11.3.

Version 6.11.1.0

  • Verified compatibility with AppLovin SDK 6.11.1.
  • Fixed an issue that caused native ads to fail to load.

Built and tested with:

  • Google Mobile Ads SDK version 7.53.1.
  • AppLovin SDK version 6.11.1.

Version 6.10.1.0

  • Verified compatibility with AppLovin SDK 6.10.1.

Built and tested with:

  • Google Mobile Ads SDK version 7.52.0.
  • AppLovin SDK version 6.10.1.

Version 6.9.5.0

  • Verified compatibility with AppLovin SDK 6.9.5.

Built and tested with:

  • Google Mobile Ads SDK version 7.50.0.
  • AppLovin SDK version 6.9.5.

Version 6.9.4.0

  • Verified compatibility with AppLovin SDK 6.9.4.
  • Fix RTB rewarded videos not being able to show even if loaded.
  • Fix adapter disallowing future ad loads of a previously-loaded zone that has been timed out by AdMob or not shown by the publisher.
  • Fix native ads not working when passing SDK key from server.
  • Validate SDK key from server, then fallback to Info.plist if server’s SDK key is invalid (e.g. in case of placeholder values being sent down).
  • Validate custom zone IDs from server (e.g. in case of placeholder values being sent down).
  • Remove placements API.

Built and tested with:

  • Google Mobile Ads SDK version 7.50.0.
  • AppLovin SDK version 6.9.4.

Version 6.8.0.0

  • Verified compatibility with AppLovin SDK 6.8.0.
  • Removed support for Native App Install ad requests. Apps must use the Unified Native Ads API to request native ads.
  • Now requires Google Mobile Ads SDK version 7.46.0 or higher.

Version 6.6.1.0

  • Verified compatibility with AppLovin SDK 6.6.1.
  • Fixed a crash caused by calling a completionHandler on a nil object.
  • Updated the adapter to handle multiple interstitial requests.
  • Added support for flexible banner ad sizes.

Version 6.3.0.0

  • Verified compatibility with AppLovin SDK 6.3.0.
  • Updated the adapter to use the new rewarded API.
  • Now requires Google Mobile Ads SDK version 7.41.0 or higher.

Version 6.2.0.0

  • Verified compatibility with AppLovin SDK 6.2.0.

Version 6.1.4.0

  • Verified compatibility with AppLovin SDK 6.1.4.

Version 5.1.2.0

  • Verified compatibility with AppLovin SDK 5.1.2.

Version 5.1.1.0

  • Verified compatibility with AppLovin SDK 5.1.1.

Version 5.1.0.0

  • Verified compatibility with AppLovin SDK 5.1.0.

Version 5.0.2.0

  • Verified compatibility with AppLovin SDK 5.0.2.

Version 5.0.1.1

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

Version 5.0.1.0

  • Verified compatibility with Applovin SDK 5.0.1.

Version 4.8.4.0

  • Verified compatibility with Applovin SDK 4.8.4.

Version 4.8.3.0

  • Add support for zones and smart banners.

Version 4.7.0.0

  • Verified compatibility with AppLovin SDK 4.7.0.

Version 4.6.1.0

  • Verified compatibility with AppLovin SDK 4.6.1.

Version 4.6.0.0

  • Verified compatibility with AppLovin SDK 4.6.0.

Version 4.5.1.0

  • Verified compatibility with AppLovin SDK 4.5.1.

Version 4.4.1.1

  • Added support for banner ads.

Version 4.4.1.0

  • Verified compatibility with AppLovin SDK 4.4.1.

Version 4.3.1.0

  • Added support for interstitial ads.

Earlier versions

  • Added support for rewarded video ads.