1. Integrate Tips
● Show Ad
- Call
isAdReady()
before showing Ad. Display the Ad if it returns True. Otherwise, initiate the Ad loading instead and wait until the Ad is loaded successfully.- If you need to show the ad within
onInterstitialAdLoaded
, you must first verify that the current application is in the foreground in order to show the ad.● Preload Ad
- To show Ad instantly, please load the Ad beforehand. (for example, call
load()
when application starts. )- Load the video in queue by calling
load()
inonInterstitialAdVideoStart()
to preload the next while playing the current one. Such will generate more impressions for highly-prioritized Ad resources.
2. Load an Interstitial Ad
💡Please call this function in advance to reduce user waiting time.
ATInterstitial mInterstitialAd = new ATInterstitial(activity, "your placement id");
//set ad listener
mInterstitialAd.setAdListener(new ATInterstitialListener() {
@Override
public void onInterstitialAdLoaded() {}
@Override
public void onInterstitialAdLoadFail(AdError adError) {
//Note: Do not call load() here, as it may lead to an ANR error
}
@Override
public void onInterstitialAdShow(ATAdInfo adInfo) {
//It is recommended to call load() here for preloading, to facilitate the display of the next ad
mInterstitialAd.load();
}
@Override
public void onInterstitialAdVideoStart(ATAdInfo adInfo) {}
@Override
public void onInterstitialAdVideoEnd(ATAdInfo atAdInfo) {}
@Override
public void onInterstitialAdVideoError(AdError adError, ATAdInfo atAdInfo) {}
@Override
public void onInterstitialAdClose(ATAdInfo atAdInfo) {}
@Override
public void onInterstitialAdClicked(ATAdInfo atAdInfo) {}
});
mInterstitialAd.load();
3. Show an Interstitial Ad
💡Tips:
● Before displaying an ad, call
isAdReady()
. If the value is true, then callshow()
to display the ad; if the value is false, initiate ad loading and wait for the ad to load successfully before displaying it.
if (mInterstitialAd.isAdReady()) {
ATShowConfig showConfig = new ATShowConfig.Builder()
.scenarioId("your scenario id")
.build();
mInterstitialAd.show(activity,showConfig);
} else {
mInterstitialAd.load();
}
4. Ad Scenario Statistics
Track the scene arrival rates, which are presented in the TopOn dashboard under Report -> Funnel Report -> Scenario.
- First, call
entryAdScenario()
- Then, call
isAdReady()
- Finally, call
show()
to display the ad
void entryAdScenario(String placementId, String scenarioId) | Enter the business scenario to track the current cache status of the ad placement. For specific usage, refer to the ad scenarios. placementId: ad placement id, you can refer to here scenarioId: ad scenario id (optional; passing null will record statistics under the default scenario) |
5. Advanced
Fully automatic loading : TopOn has launched a one-stop solution that intelligently determines the timing for preloading and caching the next ad based on the user's usage status and the progress of ad consumption.
Preset strategy : By configuring preset strategies, you can improve the ad loading performance during the app's initial cold start.
Customized interstitial ads : Native ad source mixed with interstitial placement. Refer here to obtain more information about AD Format Mixed.