App open ad

App open ads are a special ad format for monetizing your app load screens. These ads can be closed at any time and are designed to be served when users bring your app to the foreground, either at launch or when returning to it from the background.

This guide shows how to integrate an app open ad into an Android app using the Jetpack Compose extension. In addition to code examples and instructions, it provides recommendations on using this ad format and links to additional resources.

Alert

App open ads can only be placed in an app with a vertical orientation. For a horizontal orientation, ads won't be served.

Appearance

App open ads display a Go to the app button so users know they are in your app and can close the ad. Here is an example of how the ad looks:

Prerequisite

  1. Follow the SDK integration steps described in Quick start.
  2. Initialize your ad SDK in advance.
  3. Make sure you're running the latest Yandex Mobile Ads SDK version. If you're using mediation, make sure you're also running the latest version of the unified build.

Terms

  • Cold start — launching the app when it is not in memory, creating a new app session.
  • Warm start — bringing the app from background (when the app is suspended in memory) to foreground.

To use the Compose extension, add the dependency to build.gradle.kts:

dependencies {
    implementation("com.yandex.android:mobileads:8.0.0")
    implementation("com.yandex.android:mobileads-compose:8.0.0")

    // Compose BOM (minimum 2024.01.00)
    implementation(platform("androidx.compose:compose-bom:2025.03.00"))
}

Implementation

  1. Initialize the SDK when the app starts.
  2. Create an ad loader using rememberAppOpenAdLoader().
  3. Load an ad using the suspend function loadAd().
  4. Show the ad using the show(Activity) method.

Key steps

  1. Initialize the SDK when the app starts.

    MobileAds.initialize(this) {
        // Now you can use ads
    }
    
  2. Create an ad loader using rememberAppOpenAdLoader().

    You will need the ad unit ID obtained from the Yandex Advertising Network interface (AD_UNIT_ID).

    You can extend the ad request parameters via AdRequestConfiguration.Builder() by passing user interest data, page context data, location, or other additional data. Additional contextual data in the request can significantly improve ad quality. For more information, see Ad targeting.

    import com.yandex.mobile.ads.compose.rememberAppOpenAdLoader
    
    @Composable
    fun SplashScreen(activity: Activity) {
        val loader = rememberAppOpenAdLoader()
        val AD_UNIT_ID = "R-M-XXXXXX-Y" // for testing you can use "demo-appopenad-yandex"
    }
    
  3. Load the ad via LaunchedEffect using the suspend function loadAd().

    LaunchedEffect(Unit) {
        val adRequestConfiguration = AdRequestConfiguration.Builder(AD_UNIT_ID).build()
        when (val result = loader.loadAd(adRequestConfiguration)) {
            is AppOpenAdLoadResult.Success -> appOpenAd = result.ad
            is AppOpenAdLoadResult.Failure -> {
                // Ad failed to load with AdRequestError.
                // Attempting to load a new ad from here is strongly discouraged.
            }
        }
    }
    
  4. Show the ad using the show method.

    LaunchedEffect(appOpenAd) {
        appOpenAd?.show(activity)
    }
    

    Note

    If the ad has already been served, calling the show(Activity) method will return a display error in AppOpenAdEventListener.onAdFailedToShow(AdError).

Full example

import com.yandex.mobile.ads.appopenad.AppOpenAdLoadResult
import com.yandex.mobile.ads.compose.rememberAppOpenAdLoader

@Composable
fun SplashScreen(activity: Activity) {
    var appOpenAd by remember { mutableStateOf<AppOpenAd?>(null) }

    val loader = rememberAppOpenAdLoader()

    // Load immediately when entering the composable
    LaunchedEffect(Unit) {
        val adRequestConfiguration = AdRequestConfiguration.Builder("R-M-XXXXXX-Y").build()
        when (val result = loader.loadAd(adRequestConfiguration)) {
            is AppOpenAdLoadResult.Success -> appOpenAd = result.ad
            is AppOpenAdLoadResult.Failure -> Log.e("YandexAds", result.error.description)
        }
    }

    LaunchedEffect(appOpenAd) {
        appOpenAd?.show(activity)
    }
}

App open ad integration notes

  1. All Yandex Mobile Ads SDK method calls must be made from the main thread.
  2. Loading may take considerable time, so do not delay the cold start if the ad has not loaded.
  3. Pre-load the ad in advance for subsequent display on warm start.
  4. It is not recommended to load App Open Ad and other ad formats simultaneously at app startup, as the app may be downloading required data at that moment. This can overload the device and internet connection, making ad loading slower.
  5. If you receive an error in AppOpenAdLoadResult.Failure, do not attempt to load a new ad immediately. If you must retry, limit the number of reload attempts to avoid continuous failed requests and connection issues under restricted conditions.

Testing app open ad integration

Using demo ad units for ad testing

We recommend using test ads to test your integration for app open ads and your app itself.

To guarantee that test ads are returned for every ad request, we created a special demo ad placement ID. Use it to check your ad integration.

Demo adUnitId: demo-appopenad-yandex.

Warning

Before publishing your app in the store, make sure to replace the demo ad placement ID with a real one obtained from the Yandex Advertising Network interface.

You can find the list of available demo ad placement IDs in the Demo ad units for testing section.

Testing ad integration

You can check your integration of app open ads using the SDK's built-in analyzer.

The tool makes sure your app open ads are integrated properly and outputs a detailed report to the log. To view the report, search for the “YandexAds” keyword in the Logcat tool for Android app debugging.

adb logcat -v brief '*:S YandexAds'

If the integration is successful, you'll see this message:

adb logcat -v brief '*:S YandexAds'
mobileads$ adb logcat -v brief '*:S YandexAds'
I/YandexAds(13719): [Integration] Ad type App Open Ad was integrated successfully

If you're having problems integrating ads, you'll get a detailed report on the issues and recommendations for how to fix them.

Recommendations

  1. Do not show an app open ad before the loading screen (Splash screen).

    Showing a loading screen makes the app experience more pleasant and straightforward for the user. This prevents the user from being surprised or confused, as they will know exactly which app they opened. On this screen, you can also warn users about upcoming ads using a loading indicator or a text message telling the user that app content will resume after the ad.

  2. If there is a delay between the ad request and its display, the user may briefly open your app and then unexpectedly see an ad unrelated to the content. This can negatively affect the user experience, so it is worth avoiding such situations. One option is to use a loading screen before displaying the main app content and to start showing the ad from that screen. If the app opens some content after the loading screen, it is better not to show the ad at that point.

  3. Wait for new users to open the app and use it several times before showing an app open ad. Show the ad only to users who have met certain criteria in the app (for example, completed a certain level, opened the app a certain number of times, are not participating in reward offers, etc.). Do not show the ad immediately after app installation.

  4. Regulate display frequency based on user behavior in the app. Do not show an ad on every cold/warm start.

  5. Show the ad only if the app has been in the background for a certain period of time (for example, 30 seconds, 2 minutes, 15 minutes).

  6. It is important that you conduct testing, as each app is unique and requires its own approach to maximize revenue without reducing retention or time spent in the app. User behavior and engagement can change over time, so it is recommended to periodically test app open ad display strategies in your app.

Additional resources

Previous