Reputation: 303
Last 15 days until now, My admob interstitial unit id always get too low of matched requests. With 15000 Interstitial requests, i just got ~1500 matched (~10%).
I can't find what is the root cause. Whether low matched is coming from admob server side or client side (it's mean i implement as wrong way).
Someone can help me, and this is some the code that i have implemented:
Firstly, i create interstitial.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initUI();
// setup interstitial admob
interstitial = new InterstitialAd(this);
interstitial.setAdUnitId(interstitial_ad_unit_id);
interstitial.setAdListener(new AdListener() {
@Override
public void onAdLoaded() {
super.onAdLoaded();
Log.d("AdListener", "onAdLoaded");
}
@Override
public void onAdFailedToLoad(int errorCode) {
super.onAdFailedToLoad(errorCode);
Log.d("AdListener", "onAdFailedToLoad");
if (isNetworkAvailable()) {
interstitial.loadAd(new AdRequest.Builder().build());
}
}
@Override
public void onAdOpened() {
super.onAdOpened();
Log.d("AdListener", "onAdOpened");
}
@Override
public void onAdClosed() {
super.onAdClosed();
Log.d("AdListener", "onAdClosed");
interstitial.loadAd(new AdRequest.Builder().build());
}
@Override
public void onAdLeftApplication() {
super.onAdLeftApplication();
Log.d("AdListener", "onAdLeftApplication");
}
});
interstitial.loadAd(new AdRequest.Builder().build());
}
And then, whenever i need to show Ads, i call this method:
public static void displayInterstitial() {
if (interstitial.isLoaded()) {
interstitial.show();
} else {
// show another ads network instead of admob, such as StartApp
displayInterstitialStartApp();
// if interstitial is not loading then load again
if (!interstitial.isLoading()) {
interstitial.loadAd(new AdRequest.Builder().build());
}
}
}
Upvotes: 1
Views: 1098
Reputation: 20196
The best solution is to use mediation so that if Admob cannot serve an ad it falls back to other ad networks. Admob provides this out of the box, just configure the other ad networks on the Admob web page.
Upvotes: 1