Skip to main content

App Open Ads

App open ad units appear when the user opens your app or switches back to your app. App open ad units appear on the loading or splash screen.

Benefits of App Open Ads

  • An ad overlays the loading screen
  • The unique app open ad layout offers the best user experience for this placement.
  • Unlock new inventory: monetize users as soon as they open your app.
    • Maximize demands
    • Highest bidding ad creatives
    • Availability of both full-screen and partial-screen ads
    • Optimized user experience rendering
caution

You should finish these steps before releasing.

Load the ad

Yodo1U3dAppOpenAd.GetInstance().LoadAd();
Setup the auto delay load

Loading a new ad from OnAdLoadFailedEvent() without delay is not recommended. If a new ad has to be loaded immediately on OnAdLoadFailedEvent(), then the auto-delay configuration variable must be set to true to limit ad load retries, thus avoiding continuous failed ad requests and ANR issues.

// Remember to call this function before SDK init.
Yodo1U3dAppOpenAd.GetInstance().autoDelayIfLoadFail = true;

Display the ad

You can show the ad using this code, but we recommend using the ad events as you’ll be able to show the ad once it’s loaded. You can check the full script provided below.

bool isLoaded = Yodo1U3dAppOpenAd.GetInstance().IsLoaded();

// Show ad without placement name
if (isLoaded)
{
Yodo1U3dAppOpenAd.GetInstance().ShowAd();
}

// Show ad with placement name, like app_start, level_end
if (isLoaded)
{
Yodo1U3dAppOpenAd.GetInstance().ShowAd("Your placement id");
}

Configure the ad events

The MAS SDK fires several events to inform you of ad availability.

using Yodo1.MAS;
using System;

public class AppOpenAdLoader : MonoBehaviour
{
private int retryAttempt = 0;

private void Start()
{
SetupEventCallbacks();
LoadAppOpenAd();
}

private void SetupEventCallbacks()
{
Yodo1U3dAppOpenAd.GetInstance().OnAdLoadedEvent += OnAppOpenAdLoadedEvent;
Yodo1U3dAppOpenAd.GetInstance().OnAdLoadFailedEvent += OnAppOpenAdLoadFailedEvent;
Yodo1U3dAppOpenAd.GetInstance().OnAdOpenedEvent += OnAppOpenAdOpenedEvent;
Yodo1U3dAppOpenAd.GetInstance().OnAdOpenFailedEvent += OnAppOpenAdOpenFailedEvent;
Yodo1U3dAppOpenAd.GetInstance().OnAdClosedEvent += OnAppOpenAdClosedEvent;
}

private void LoadAppOpenAd()
{
Yodo1U3dAppOpenAd.GetInstance().SetAdPlacement("Your placement id");
Yodo1U3dAppOpenAd.GetInstance().LoadAd();
}

private void OnAppOpenAdLoadedEvent(Yodo1U3dAppOpenAd ad)
{
// Code to be executed when an ad finishes loading.
retryAttempt = 0;
Yodo1U3dAppOpenAd.GetInstance().ShowAd();
}

private void OnAppOpenAdLoadFailedEvent(Yodo1U3dAppOpenAd ad, Yodo1U3dAdError adError)
{
// Code to be executed when an ad request fails.
retryAttempt++;
double retryDelay = Math.Pow(2, Math.Min(6, retryAttempt));
Invoke("LoadAppOpenAd", (float) retryDelay);
}

private void OnAppOpenAdOpenedEvent(Yodo1U3dAppOpenAd ad)
{
// Code to be executed when an ad opened
}

private void OnAppOpenAdOpenFailedEvent(Yodo1U3dAppOpenAd ad, Yodo1U3dAdError adError)
{
// Code to be executed when an ad open fails.
}

private void OnAppOpenAdClosedEvent(Yodo1U3dAppOpenAd ad)
{
// Code to be executed when the ad closed
}
}

Video Tutorial

Best Practices

  • It is required to show a splash screen or loading screen before the App Open Ad.
  • Ensure that MAS SDK is initialized before you load an app open ad.
  • When an app open ad is not loaded (i.e. on cold start), only load app open ads first and load all other ad formats later to avoid parallel loading with the app open ad. See here, Optimize App Open Ad Loading Time.