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:
|Rewarded Video (new APIs)|
|Native Ads - Custom Rendering|
|Automatic Data Collection|
- Xcode 9.2 or higher
- iOS Deployment target of 9.0 or higher
- Google Mobile Ads SDK 7.42.2 or higher
Step 1: Set up AppLovin
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.
If you do not see your app in the list, it is not registered. In that case, perform the four steps below to get it registered.
Before you can complete the Ad Manager mediation setup, your app needs to be registered by AppLovin. Once your app initializes the AppLovin SDK, AppLovin automatically detects and registers it. To complete this process:
- Follow the steps in the Import the AppLovin SDK section. Once that's done, you'll have the AppLovin SDK integrated in your app.
In your app's
Info.plistfile, click on one of the rows of Custom iOS Properties and click the + (plus sign) to add a new row. The key of the new row will be AppLovinSdkKey and the value will be the AppLovin SDK Key obtained earlier.
Finally, in your app, add the snippet below to your
#import <AppLovinSDK/AppLovinSDK.h> [ALSdk initializeSdk];
Build and run your app, then wait thirty minutes or so. Afterwards, check the AppLovin dashboard under Monetize > Manage Apps to find your app. Once the registration process is complete, remove the two statements above from your
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
Using CocoaPods (recommended)
Add the following line to your project's Podfile:
From the command line run:
pod install --repo-update
Download the latest version of the AppLovin iOS SDK and link
ApplovinSDK.frameworkin your project.
Download the latest version of the ApplovinAdapter and link
ApplovinAdapter.frameworkin your project.
Add the following frameworks 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.
EU consent and GDPR
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
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.
#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
See AppLovin's privacy settings for more details.
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:
let request = DFPRequest() let extras = GADMAdapterAppLovinExtras() extras.muteAudio = false request.register(extras)
DFPRequest *request = [DFPRequest request]; GADMAdapterAppLovinExtras * extras = [[GADMAdapterAppLovinExtras alloc] init]; extras.muteAudio = NO; [request registerAdNetworkExtras:extras];
[ALSdk initializeSdk]; to your
AppDelegate provides AppLovin the
ability to track events as soon as the app starts.
AppLovin iOS Mediation Adapter Changelog
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- Verified compatibility with AppLovin SDK 6.2.0.
- Verified compatibility with AppLovin SDK 6.1.4.
- Verified compatibility with AppLovin SDK 5.1.2.
- Verified compatibility with AppLovin SDK 5.1.1.
- Verified compatibility with AppLovin SDK 5.1.0.
- Verified compatibility with AppLovin SDK 5.0.2.
- Add support for native ads.
- Set AdMob as mediation provider on the AppLovin SDK.
- Verified compatibility with Applovin SDK 5.0.1.
- Verified compatibility with Applovin SDK 4.8.4.
- Add support for zones and smart banners.
- Verified compatibility with AppLovin SDK 4.7.0.
- Verified compatibility with AppLovin SDK 4.6.1.
- Verified compatibility with AppLovin SDK 4.6.0.
- Verified compatibility with AppLovin SDK 4.5.1.
- Added support for banner ads.
- Verified compatibility with AppLovin SDK 4.4.1.
- Added support for interstitial ads.
- Added support for rewarded video ads.