---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://ads.yandex.com/helpcenter/en/dev/android7/quick-start-mm.md
  - https://ads.yandex.com/helpcenter/ru/dev/android7/quick-start-mm.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ads.yandex.com/helpcenter/en/llms.txt

# Integrating Yandex Mediation

{% note warning %}

Make sure to update your used [Yandex Mediation](https://ads.yandex.com/helpcenter/en/dev/android7/list-network.md) adapters and [adapters for third-party mediation networks](https://ads.yandex.com/helpcenter/en/dev/android7/third-party-mediation.md) to the latest version. Older versions may cause adapter integration errors that can prevent your ads from being served.

{% endnote %}

[Yandex Mediation](https://ads.yandex.com/helpcenter/en/monetization/yandex-mediation/index.md) is a platform that automatically selects ads from a variety of networks using ML algorithms to maximize your revenue. All settings are turnkey, meaning there's no need to debug each network separately.

If you previously used the Yandex Mobile Ads SDK with only one Yandex network, you won't need to change anything in the code to switch to Yandex Mediation. You only need to pre-configure the units in the web interface of external ad networks.

## Preliminary setup {#prolog}

To prepare your app, follow the steps from the next sections.

### App requirements {#requirements}

- Use Android Studio 2021 or higher.
- Use Android Gradle Plugin 8.7.0 or higher.
- Make sure your app's build file uses the following values:
   - minSdkVersion 21 or later.
   - compileSdkVersion 34 or later.
- To load ads no matter the type, you need Android 4.1 or later.
- Video ads are only selected for devices with Android 5 or higher.
- If you are using the [AppMetrica SDK](https://appmetrica.yandex.com) in your application, make sure you have installed the version 7.14.3 and above (within one major version).

### Set up the application in your Yandex Advertising Network account {#yan}

<!-- source: en/dev/_includes7/reg.md -->
Here's how to register your app in the Yandex Advertising Network:

1. [Log in](https://partner.yandex.com/) or [register](https://passport.yandex.ru/auth/list?origin=rsy_ligth_in&retpath=https%3A%2F%2Fpartner.yandex.ru%2Fform%2F?roles%5B%5D=27) your account in the Yandex Advertising Network.
2. [Register](https://passport.yandex.ru/auth/list?origin=rsy_ligth_in&retpath=https%3A%2F%2Fpartner.yandex.ru%2Fform%2F?roles%5B%5D=27) your app in the Yandex Advertising Network.
<!-- endsource: en/dev/_includes7/reg.md -->

## Integration {#integration}

To add individual adapters, enable Yandex Ads SDK and relevant adapters by following the instructions:

1. [Set up mediation](https://ads.yandex.com/helpcenter/en/monetization/yandex-mediation/setup.md) in the Yandex Advertising Network interface.
2. Add the YandexMobileAds dependency to the build.gradle file in your app's module:

      ```groovy
      dependencies {
         ...
         implementation 'com.yandex.android:mobileads:x.x.x' // add supported version

         // Add dependencies on Yandex Mediation adapters.

      }
      ```

3. Add Java 8 support to the build.gradle file in your app's module:

      ```groovy
      android {

          compileOptions {
              sourceCompatibility JavaVersion.VERSION_1_8
              targetCompatibility JavaVersion.VERSION_1_8
          }
      }
      ```
4. Add the following code to the build.gradle file in your app's module:

      <!-- source: en/dev/_includes7/build-gradle-code.md -->
      ```groovy
      // IronSource
      maven {
             url 'https://android-sdk.is.com/'
      }

      // Pangle
      maven {
             url 'https://artifact.bytedance.com/repository/pangle'
      }

      // Tapjoy
      maven {
             url "https://sdk.tapjoy.com/"
      }

      // Mintegral
      maven {
             url "https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea"
      }

      // Chartboost
      maven {
             url "https://cboost.jfrog.io/artifactory/chartboost-ads/"
      }

      // AppNext
      maven {
             url "https://dl.appnext.com/"
      }
      ```
      <!-- endsource: en/dev/_includes7/build-gradle-code.md -->

5. Set up permission to use the ad ID (for apps running SDK versions below 4.5.0).

      <!-- source: en/dev/_includes7/ad-id.md -->
      {% cut "How to set up permission to use the ad ID" %}

      The ad ID is a unique identifier provided by Google Play services for displaying ads to users who opt in to personalized ads. Users can opt out of ad personalization or reset their ID in the settings. In this case, advertising networks won't be able to use the ID to select relevant ads for the user.

      If your app runs a Yandex Mobile Ads SDK version below 4.5, add com.google.android.gms.permission.AD_ID to the AndroidManifest.xml file:
      ```xml
      <manifest>
          <application>
          <!-- For apps targeting Android 13 or higher & Yandex Mobile Ads SDK versions lower than 4.5.0 -->
              <uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
          </application>
      </manifest>
      ```

      As of version 4.5.0, the Yandex Mobile Ads SDK adds com.google.android.gms.permission.AD_ID by default. Because of this, you don't have to specify it in the application's main manifest. The permission allows you to use an ad ID to select more relevant ads from advertising networks.

      You can delete the permission if necessary. For example, if a policy does not allow the use of an ID for ad selection, such as the Families Policy.

      To keep the permission from being added to the application's main manifest, add the following code to AndroidManifest.xml:
      ```xml
      <manifest>
          <application>
              <uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/>
          </application>
      </manifest>
      ```
      {% endcut %}
      <!-- endsource: en/dev/_includes7/ad-id.md -->

      {% note warning %}

      Lack of this permission and access to the ID may reduce the relevance of ads and, as a result, your income.

      {% endnote %}

6. Add the applicable [adapters](https://ads.yandex.com/helpcenter/en/dev/android7/list-network.md) one by one using the appropriate packages.
