Google AdMob (ex. AdMob) mediation

Note

Follow this guide if you're already using Google AdMob mediation and want to add Yandex Advertising Network as a custom event.

If you want to manage external ad networks through the Yandex Advertising Network interface, use Yandex Mobile Mediation.

You can connect to the Yandex Advertising Network via Google AdMob (ex. AdMob) mediation. To add the Yandex Advertising Network to Google AdMob (ex. AdMob) mediation, follow these steps:

  1. Integrate Google AdMob (ex. AdMob) mediation.
  2. Connect the adapter for the Yandex Mobile Ads SDK.
  3. Create an AdUnitId for your selected ad type in the Yandex Advertising Network interface.
  4. Add the Yandex Advertising Network in the Google AdMob (ex. AdMob) web interface.
  5. Sync the ad unit settings between the two web interfaces.

Connecting an adapter for the Yandex Mobile Ads SDK

To integrate the Yandex Advertising Network with Google AdMob (ex. AdMob) mediation, add the adapter dependency to the build.gradle file of your project's module:

dependencies {
    ...
    implementation 'com.yandex.ads.adapter:admob-mobileads:8.0.0.0'
}

To manually transmit GDPR (user consent) and COPPA (age-restricted user) values from the app code to the Yandex Mobile Ads SDK, make sure to also enable the Yandex Mobile Ads SDK. Add the following to the dependencies block:

implementation "com.yandex.android:mobileads:8.0.0.0"

Adding the Yandex Advertising Network in the Google AdMob (ex. AdMob) mediation web interface

For each ad placement (AdMob AdUnitId) in Google AdMob (ex. AdMob) mediation, create a corresponding ad unit (Yandex Ad Unit ID) in the Yandex Advertising Network interface.

Next, add the Yandex Advertising Network in the Google AdMob (ex. AdMob) mediation web interface:

1. Create a Google AdMob (ex. AdMob) ad unit

  1. Go to your app section.
  2. Create an ad unit for the selected ad format and configure the ad placement parameters (for example, its name).
  3. After creating the ad unit, save its ID.
Screenshots from the Google AdMob (ex. AdMob) interface

2. Create a Yandex ad unit

Guide for creating an ad unit in the Yandex Advertising Network interface.

3. Set up Google AdMob (ex. AdMob) mediation

  1. In the Google AdMob (ex. AdMob) web interface, go to MediationMediation groups and click Create mediation group.

  2. Select a platform.

  3. Set the mediation group parameters, such as name and region, then proceed to adding the ad placement.

  4. Select your app, select the ad unit you created, and add it. The ad unit you added should appear in the Ad Units section.

  5. The Yandex Advertising Network can be added to Google AdMob (ex. AdMob) mediation only as a custom event. Click Add Custom Event to add a custom event. Set up your custom event for each adUnitId created in the Yandex Advertising Network interface.

  6. Configure a custom event for accessing the Yandex Advertising Network by setting the event name and eCPM floor.

    Warning

    The eCPM floor currency and value must match the floor you set for the ad placement in the Yandex Advertising Network interface.

    If you selected the Maximum revenue strategy for the ad placement in the Yandex Advertising Network interface without a set floor, enter the expected or historical eCPM in AdMob. AdMob uses this value to position the custom event in the waterfall.

  7. Set up mapping of the custom event to the Yandex adapter:

    • Set the mapping name.
    • Set an adapter class name that corresponds to your selected ad format.
    • Set the event parameters.

    Each ad format has a corresponding Yandex adapter class:

    • com.admob.mobileads.YandexBanner for banner ads.
    • com.admob.mobileads.YandexInterstitial for interstitial ads.
    • com.admob.mobileads.YandexRewarded for rewarded ads.
    • com.admob.mobileads.YandexNative for native ads.

    In the Parameter field, configure the custom event settings in JSON format. Make sure to set the Yandex Ad Unit ID for your selected ad placement: {"adUnitId": "R-M-XXXXXX-X"}.

    Warning

    The Yandex adapter class name and the adUnitId JSON key are case-sensitive. Make sure you spell them correctly, otherwise ads might not load from the custom event.

    For native ads, when connecting to the Yandex Advertising Network via Google AdMob (ex. AdMob), you must provide the store/storeView, which is needed to pass the required domain asset. If the storeView isn't registered or displayed, the impression may not be counted. For compact layouts, you can use a separate, single-line TextView without a signature, registered as the storeView.

  8. Save the changes.

Screenshots from the Google AdMob (ex. AdMob) interface

4. Test the integration

Before you publish your app, make sure you've set up the custom event correctly:

  1. Check that you entered the adapter class name exactly as shown in Step 7.
  2. Make sure your custom event parameter uses the correct JSON format: {"adUnitId": "R-M-XXXXXX-X"}.
  3. Test the integration using demo ad units or test placements.
  4. Check your app logs and the Debug Panel for any adapter initialization or ad loading errors.