This guide is intended for publishers who want to use the Google Mobile Ads SDK to load and display ads from AppLovin Ads via Open Bidding mediation. It covers how to integrate the AppLovin SDK and adapter into a Unity app.
Supported ad formats and features
- Unity 4 or higher
- To deploy on Android
- Early access build of Google Mobile Ads Android SDK
- Android API level 14 or higher
- To deploy on iOS
- Google Mobile Ads SDK 7.42.2 or higher
- Xcode 9.2 or higher
- iOS Deployment target of 8.0 or higher
- Follow the Open Bidding Get Started guide to import the early access build of the Google Mobile Ads SDKs
- Complete Initialize the Mobile Ads SDK
Step 1: Set up AppLovin
To set up your AdMob ad unit, you'll need your AppLovin SDK Key. To find it, go to the AppLovin Dashboard and click on the Account tab. In the dropdown list under Account, select Keys.
Step 2: Configure mediation settings for your AdMob ad unit
You need to add AppLovin to the mediation configuration for your ad unit.
First, sign in to your AdMob account. Next, 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, and then click Add Ad Units.
Associate this mediation group with one or more of your existing AdMob 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 (Open Bidding). Then enter the SDK Key obtained in the earlier section.
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 Apply to all networks in Mediation groups box.
If you don't apply this setting, the AppLovin adapter passes back the reward specified in the AppLovin dashboard when creating the placement.
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 Google Mobile Ads mediation package for AppLovin and extract the
GoogleMobileAdsAppLovinMediation.unitypackage file from the archive.
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.
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.
The Google Mobile Ads mediation plugin for
version 3.0.1 includes the
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
See AppLovin's Frequently Asked Questions for GDPR for more details.