App open ad

App open ads are a special ad format for monetizing app load screens. These ads can be closed at any time and are designed to be served:

  • When the app is launched.
  • When the app is brought to the foreground.
  • When returning to the app from the background.

This guide covers the process of integrating app open ads into Android apps using the Jetpack Compose extension. Besides code samples and instructions, it contains recommendations and links to additional resources.

Alert

App open ads are only supported for apps with a vertical orientation. These ads won't be served for apps with a horizontal orientation.

Appearance

The ad contains a Go to the app button, which appears at the top. It indicates to users that they're currently in your app and lets them close the ad.

Prerequisite

  1. Follow the SDK integration steps described under Quick start.
  2. First, you need to initialize the advertising SDK.
  3. Make sure you have the latest Yandex Mobile Ads SDK version. If you're using mediation, update to the most recent single build version.

Terms

  • Cold start: Launching the app when it isn't present in RAM. This creates a new app session.
  • Hot start: Bringing the app from the background to the foreground. This occurs when the app is paused in RAM and resumes its active state.

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

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

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

Implementation

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

Key steps

  1. Initialize the SDK on app startup.

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

    You'll need the ad placement ID obtained in the Boost interface (AD_UNIT_ID).

    You can expand the ad request parameters using AdRequestConfiguration.Builder(). To do this, pass information about the user's interests, page context, location, and other additional data in the request. Context can greatly improve the ad quality. To learn more, 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" // you can use "demo-appopenad-yandex" for debugging
    }
    
  3. Load the ad through LaunchedEffect using the loadAd() suspend function.

    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. Serve 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 upon entry into 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)
    }
}

Features of App Open Ad integration

  1. All calls to Yandex Mobile Ads SDK methods must be made from the main thread.
  2. Ads may take a long time to load, so avoid increasing the cold start time if the ad hasn't loaded.
  3. Preload ads for subsequent hot start impressions in advance.
  4. Don't load app open ads simultaneously with other ad formats at app startup, as the app may be downloading essential operational data. Doing so may lead to excessive loads on the device and internet connection, as well as increase ad load times.
  5. If an AppOpenAdLoadResult.Failure error occurs, don't try to load a new ad again. If you have to, limit the number of ad loading retries to avoid unsuccessful requests and connection issues.

Testing App Open Ad integration

Using demo ad units for ad testing

Use test ads to check your ad integration and the app itself. To make sure that test ads are returned for each ad request, you can use a special demo ad placement ID.

Demo adUnitId: demo-appopenad-yandex.

Warning

Before publishing your app in the store, make sure to replace the demo placement ID with the real ID you obtained in the Boost interface.

For the list of all available demo ad placement IDs, see Demo ad units for testing.

Testing ad integration

You can check if your app open ads are integrated correctly using the SDK's built-in analyzer. A detailed report with the test results will appear in the log.

To view the report, search for the keyword “YandexAds” in Logcat, a tool for debugging Android apps.

adb logcat -v brief '*:S YandexAds'

If the integration is successful, the following message is returned:

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 there are any ad integration issues, you'll get a detailed issue report and troubleshooting recommendations.

Recommendations

  1. Avoid showing app open ads before the app reaches the splash screen. Splash screens improve the user experience. This way, the user can be sure they opened the right app.

    In addition, you can use this screen to warn users about the upcoming ad. Use a loading indicator or a text message informing the user that they can continue viewing the app content after the ad.

  2. Make sure to account for the delay between the ad request and the impression.

    If there's a delay between the ad request and the impression, the user may see an ad that is unrelated to the app content. One solution is to show the splash screen before displaying the main app content and to begin ad impressions from that screen. We don't recommend displaying an ad if the app has already opened content after the splash screen.

  3. Avoid displaying ads immediately after the app is installed. Wait until the new user opens the app and uses it a few times.

    Show the ad only to users who meet specific in-app criteria. For example, if they completed a specific level, opened the app a certain number of times, or don't participate in reward offers.

  4. Avoid serving an ad at every cold or hot app start. Adjust the frequency of impressions based on user behavior.

  5. Display ads only if the app has been running in the background for a certain time (for example, 30 seconds, 2 minutes, or 15 minutes).

  6. Run a test. Each app requires an individual approach to maximize revenue. To account for changes in user behavior and engagement, we recommend periodically testing different display strategies for in-app ads.

Additional resources