<br />

This guide shows you how to use the Google Mobile Ads SDK for React Native to load and display
ads from AppLovin using
[mediation](https://developers.google.com/admob/react-native/mediation.md.txt), covering both bidding and waterfall
integrations. It covers how to add
AppLovin to an ad unit's mediation
configuration, and how to integrate the
AppLovin SDK and adapter into a
React Native app.

## Supported integrations and ad formats

The AdMob mediation adapter for
AppLovin has the following
capabilities:

| Integration ||
|---|---|
| Bidding | Yes |
| Waterfall | Yes |
| App Open | Yes [^1^](https://developers.google.com/admob/react-native/mediation/applovin.md.txt#app-open-footnote) |
| Banner | Yes [^2^](https://developers.google.com/admob/react-native/mediation/applovin.md.txt#banner-footnote) |
| Interstitial | Yes |
| Rewarded | Yes |
| Rewarded Interstitial |   |
| Native |   |

^1^ Waterfall integration is in
closed beta.

^2^ Waterfall supports only 320x50
and 728x90 banner sizes. Bidding doesn't support banner ads.

## Prerequisites

Before you continue, verify the following:

- Latest Google Mobile Ads SDK for React Native version.
- React Native framework version 0.85.0 or later.
- To deploy on Android
  - Android API level 24 or later.
- To deploy on iOS
  - iOS deployment target of 13.0 or later.
- A working React Native project configured with Google Mobile Ads SDK for React Native. See [Set up Google Mobile Ads SDK for React Native](https://developers.google.com/admob/react-native/quick-start.md.txt) for details.
  - Make sure you have downloaded and extracted the `adapters` folder from the [`gma-sdk-react-native`](https://drive.google.com/corp/drive/folders/1s5j2kx0yyYxLsdLNyBrhNJvkzmaUgOwD) folder. If you don't have the `adapters` folder, follow steps one, two, and three in [Install Google Mobile Ads SDK for React Native](https://developers.google.com/admob/react-native/quick-start.md.txt#install).
- [Set up AdMob Mediation](https://developers.google.com/admob/react-native/mediation.md.txt).

## Step 1: Set up configurations in AppLovin UI

[Sign up](https://dash.applovin.com/signup) or [log in](https://dash.applovin.com/login)
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 UI](https://dash.applovin.com/login) \> **Account** \> **Keys** to see
both values.

![](https://developers.google.com/static/admob/images/mediation/applovin/keys.png)

If you plan on just integrating bidding, you can proceed to
[configure your mediation settings](https://developers.google.com/admob/react-native/mediation/applovin.md.txt#configure-mediation).

### Select app for mediation

### Bidding

This step isn't required for bidding integrations.

### Waterfall

On the AppLovin UI, 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.

![](https://developers.google.com/static/admob/images/mediation/applovin/manage_apps_list.png)

### Create a zone

### Bidding

This step isn't required for bidding integrations.

### Waterfall

On the AppLovin UI, 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 [Step 2](https://developers.google.com/admob/react-native/mediation/applovin.md.txt#step-2).
To create a new zone ID, click **Create Zone**.

![](https://developers.google.com/static/admob/images/mediation/applovin/manage_zones.png)

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

### Android

![](https://developers.google.com/static/admob/images/mediation/applovin/create_zone_Android.png)

### iOS

![](https://developers.google.com/static/admob/images/mediation/applovin/create_zone_iOS.png)

Once the zone is created, the zone ID can be found under the **Zone ID**
column.

### Android

![](https://developers.google.com/static/admob/images/mediation/applovin/zone_id_Android.png)

### iOS

![](https://developers.google.com/static/admob/images/mediation/applovin/zone_id_iOS.png)

> [!NOTE]
> **Note:** We highly recommend that you create an AppLovin zone corresponding to each AdMob ad unit so that AdMob can more effectively [Optimize ad sources in mediation](https://support.google.com/admob/answer/7374110).

### Update your app-ads.txt


[Authorized Sellers for Apps app-ads.txt](https://iabtechlab.com/wp-content/uploads/2019/03/app-ads.txt-v1.0-final-.pdf) is an IAB Tech Lab initiative that helps ensure your
app ad inventory is only sold through channels you've identified as authorized. To prevent a
significant loss in ad revenue, you'll need to implement an `app-ads.txt` file.

If you haven't done so already,

[set up an app-ads.txt file for your app](https://support.google.com/admob/answer/9363762).

To implement `app-ads.txt` for AppLovin,
[Add AppLovin to your app-ads.txt file](https://developers.applovin.com/en/max/max-dashboard/account/iab-supply-chain-validation#how-to-implement-an-app-adstxt-file).

### Turn on test mode

Follow the instructions in AppLovin's

[MAX Test Mode](https://dash.applovin.com/documentation/mediation/ios/testing-networks/test-mode)
guide on how to enable AppLovin test ads.

## Step 2: Set up AppLovin demand in AdMob UI

### Configure mediation settings for your ad unit

### Android

For instructions, see step 2 in the guide for

[Android](https://developers.google.com/admob/android/mediation/applovin.md.txt#step-2).

### iOS

For instructions, see step 2 in the guide for

[iOS](https://developers.google.com/admob/ios/mediation/applovin.md.txt#step-2).

### Add AppLovin Corp. to GDPR and US state regulations ad partners list

> [!IMPORTANT]
> **Important:** Verify that you have **Account Management** permission to complete the configuration for EU Consent and GDPR, US State regulations, and User Messaging Platform. See [Manage user access to your
> account](https://support.google.com/admob/answer/2784628) for details.

Follow the steps in

[European regulations settings](https://support.google.com/admob/answer/10113004#adding_ad_partners_to_published_gdpr_messages)

and

[US state regulations settings](https://support.google.com/admob/answer/14125907)


to add **AppLovin Corp.** to the
European and US state regulations ad partners list in the AdMob UI.


## Step 3: Import the AppLovin SDK and adapter

> [!NOTE]
> **Note:** Failure to integrate the compatible AppLovin and Google Mobile Ads SDK for React Native versions might lead to build issues.

In your project's root directory, install the Google Mobile Ads SDK for React Native
mediation adapter for AppLovin.
Complete the following:

1. Copy the Google Mobile Ads SDK for React Native adapter tar file from the
   `gma-sdk-react-native/adapters/applovin/`
   directory into your project's `local_packages/` directory. If you don't have
   the `adapters` folder, see [Prerequisites](https://developers.google.com/admob/react-native/mediation/applovin.md.txt#prerequisites).

   ```bash
   mkdir -p local_packages
   cp EXTRACT_DIR/gma-sdk-react-native/adapters/applovin/gma-mediation-applovin-0.1.0.tgz local_packages/
   ```

   Replace <var class="readonly" translate="no">EXTRACT_DIR</var> with the path to the
   directory where you extracted the archive.
2. Install the adapter package using your preferred package manager:

   ### npm

   ```bash
   npm install ./local_packages/gma-mediation-applovin-0.1.0.tgz
   ```

   ### yarn

   ```bash
   yarn add ./local_packages/gma-mediation-applovin-0.1.0.tgz
   ```


## Step 4: Implement privacy settings on AppLovin SDK

### EU consent and GDPR


To [comply with
the Google EU User Consent Policy](https://www.google.com/about/company/consentstaging.html), you must make certain disclosures to your
users in the European Economic Area (EEA), the UK, and Switzerland, and obtain
their consent for the use of cookies or other local storage where legally
required, and for the collection, sharing, and use of personal data for ads
personalization. This policy reflects the requirements of the EU ePrivacy
Directive and the General Data Protection Regulation (GDPR). You are
responsible for verifying that consent is propagated to each ad source in your
mediation chain.

AppLovin React Native adapter version
0.1.0
and later supports passing GDPR consent signals from [UMP SDK](https://developers.google.com/admob/react-native/privacy.md.txt)
and consent management platforms that integrate with

[Google's Additional Consent specification](https://support.google.com/admob/answer/9681920)

to AppLovin SDK.
For more information, see

[TCF v2 consent](https://support.applovin.com/en/max/react-native/overview/privacy#tcf-v2-consent).


### Declare child users

AppLovin does not support
initialization of the
AppLovin SDK in connection with a
child. For more information, see
AppLovin's documentation on
"Prohibition on Children Data or Using the Services for Children or Apps
Exclusively Targeted to Children" for
[Android](https://developers.applovin.com/en/max/android/overview/privacy#children)
or [iOS](https://developers.applovin.com/en/max/ios/overview/privacy#children).

The Google Mobile Ads React Native mediation plugin for
AppLovin

automatically disables mediation to
AppLovin

for apps that declare a child user using [set the age treatment](https://developers.google.com/admob/react-native/targeting.md.txt#set_the_age_treatment).


### US states privacy laws


[US states privacy laws](https://support.google.com/admob/answer/9561022)
require giving users the right
to opt out of the "sale" of their "personal information" (as the law defines
those terms), with the opt-out offered through a prominent "Do Not Sell My Personal
Information" link on the "selling" party's homepage. The
[US states privacy
laws compliance guide](https://developers.google.com/admob/react-native/privacy/us-states) offers the ability to enable
[restricted data processing](https://privacy.google.com/businesses/rdp/)
for Google ad serving, but Google is unable to apply this setting to each ad
network in your mediation chain. Therefore, you must identify each ad network
in your mediation chain that may participate in the sale of personal
information and follow guidance from each of those networks to ensure
compliance.

The Google Mobile Ads mediation plugin for
AppLovin

includes the

`AppLovinMediation.setDoNotSell()`

method. The following sample code shows how to pass consent information to the
AppLovin SDK. These options must be
set before you [initialize the Google Mobile Ads
SDK](https://developers.google.com/admob/react-native/quick-start#initialize_the_mobile_ads_sdk) to ensure they get
forwarded properly to the
AppLovin SDK.

```javascript
import { AppLovinMediation } from '@google/gma-mediation-applovin';
// ...

AppLovinMediation.setDoNotSell(true);
```

See [AppLovin's Privacy
documentation](https://dash.applovin.com/documentation/mediation/android/getting-started/privacy#california-consumer-privacy-act-(%E2%80%9Cccpa%E2%80%9D))
for more information.

## Step 5: Add required code

### Android

No additional code is required for
AppLovin integration.

### iOS

### SKAdNetwork integration

Follow [AppLovin's
documentation](https://dash.applovin.com/documentation/mediation/ios/getting-started/skadnetwork-info)
to add the SKAdNetwork identifiers to your project's Info.plist\` file.

## Step 6: Test your implementation

### Enable test ads

Make sure you
[register your test device](https://developers.google.com/admob/react-native/test-ads.md.txt#enable_test_devices)
for

AdMob and [enable test mode](https://developers.google.com/admob/react-native/mediation/applovin.md.txt#turn-on-test-mode) in
AppLovin UI.


> [!IMPORTANT]
> **Important:** Disable test mode for AdMob and AppLovin before releasing your app.

### Verify test ads

To verify that you are receiving test ads from
AppLovin,
enable
[single ad source testing](https://developers.google.com/admob/react-native/ad-inspector#single_ad_source_testing)
in ad inspector using the
**AppLovin (Bidding) and AppLovin (Waterfall)** ad source(s).

## Optional steps

### Network-specific parameters

The AppLovin adapter supports passing an `AppLovinMediationExtras` object to the
ad request to set network-specific parameters. The following sample code shows
how to disable audio on video ads using the `isMuted` parameter:

```javascript
import { AdRequest } from '@google/mobile-ads';
import { AppLovinMediationExtras } from '@google/gma-mediation-applovin';

const request: AdRequest = {
  // ...
  mediationExtras: [
    new AppLovinMediationExtras({
      isMuted: true, // Mute audio for AppLovin ads
    }),
  ],
};
```

### Optimizations

Adding a call to

to your launch activity provides
AppLovin the ability to track events
as soon as the app starts.

## Error codes

If the adapter fails to receive an ad from AppLovin,
publishers can check the underlying error from the ad response using
[`ResponseInfo`](https://developers.google.com/admob/react-native/response-info.md.txt) under the
following classes:

### Android

```java
com.google.ads.mediation.applovin.mediation.ApplovinAdapter
com.google.ads.mediation.applovin.AppLovinMediationAdapter
```

### iOS

```objective-c
GADMAdapterAppLovin
GADMAdapterAppLovinRewardBasedVideoAd
GADMediationAdapterAppLovin
```

Here are the codes and accompanying messages thrown by the AppLovin adapter
when an ad fails to load:

### Android

| Error code | Reason |
|---|---|
| -1009 to -1, 204 | AppLovin SDK returned an error. See [AppLovin's documentation](https://dash.applovin.com/docs/integration#androidErrors) for more details. |
| 101 | The requested ad size does not match an AppLovin supported banner size. |
| 103 | Context is null. |
| 104 | AppLovin bid token is empty. |
| 105 | Requested multiple ads for the same zone. AppLovin can only load 1 ad at a time per zone. |
| 106 | Ad is not ready to display. |
| 108 | AppLovin Adapter does not support the ad format being requested. |
| 109 | Context is not an Activity instance. |
| 110 | SDK key is missing. |
| 112 | User is a child. |
| 113 | Ad unit ID is missing. |

### iOS

| Error code | Reason |
|---|---|
| -1009 to -1, 204 | AppLovin SDK returned an error. See [AppLovin's documentation](https://dash.applovin.com/docs/integration#iosErrors) for more details. |
| 101 | The requested ad size does not match an AppLovin supported banner size. |
| 102 | AppLovin server parameters configured in the AdMob UI are missing/invalid. |
| 103 | Failed to show AppLovin ad. |
| 104 | Requested multiple ads for the same zone. AppLovin can only load 1 ad at a time per zone. |
| 105 | AppLovin SDK key not found. |
| 107 | Bid token is empty. |
| 108 | AppLovin Adapter does not support the ad format being requested. |
| 110 | AppLovin sent a successful load callback but loaded zero ads. |
| 111 | Unable to retrieve instance of the AppLovin SDK. |
| 112 | User is a child. |
| 113 | AppLovin SDK shared instance has not been initialized. |
| 114 | AppLovin SDK fails to return bid token. |
| 115 | Ad unit ID is missing. Cannot load ad. |
| 116 | Ad is not ready. Cannot display the ad. |

#### Version 0.1.0

- Initial release.

<!-- -->

- Supports [AppLovin Android adapter version 13.6.4.1](https://github.com/googleads/googleads-mobile-android-mediation/blob/main/ThirdPartyAdapters/applovin/CHANGELOG.md#version-13641).
- Supports [AppLovin iOS adapter version 13.6.4.0](https://github.com/googleads/googleads-mobile-ios-mediation/blob/main/adapters/AppLovin/CHANGELOG.md#version-13640).
- Built and tested with the Google Mobile Ads React Native Plugin version 0.1.0.