Mediation/Interstitial issue

75 views
Skip to first unread message

Clement Vitroly

unread,
Mar 12, 2018, 4:53:35 PM3/12/18
to Google Mobile Ads SDK Developers
Hi,

I have an issue using AdMob and mediation. To reproduce the issue I set a mediation network on the top of list on AdMob dashboard, for example Unity ads. If I set Admob as the first on the list, I get the message error but the ads are always displayed.

Each time I launch the game, the first interstitial is displayed. But when I try to load a second interstitial I get this message from log :
"An interstitial is already loading. Aborting."
I know this message appear when we try to load an interstitial two times. But I carefully code and I only send a load Request once:

My code (I'm using a plugin):

public void Init () {
    GoogleMobileAd.OnInterstitialLoaded += OnInterstisialsLoaded;
    GoogleMobileAd.OnInterstitialFailedLoading += OnInterstisialsFailed;

    IsInterstisialsAdLoading = true;
    GoogleMobileAd.LoadInterstitialAd ();
}

private void OnInterstisialsLoaded() {
    IsInterstisialsAdLoading = false;
    IsInterstisialsAdReady = true;
    Debug.Log ("InterstitialLoading = " + IsInterstisialsAdLoading);
}

private void OnInterstisialsFailed() {
    IsInterstisialsAdLoading = false;
    IsInterstisialsAdReady = false;
    Debug.Log ("InterstitialFailedLoading = " + IsInterstisialsAdLoading);
}

public static void ShowAdsImmediate() {
    Debug.Log ("InterstitialLoading = " + IsInterstisialsAdLoading);
    Debug.Log ("InterstitialReady = " + IsInterstisialsAdReady);

    if (IsInterstisialsAdReady == true) {
        GoogleMobileAd.ShowInterstitialAd ();
        IsInterstisialsAdReady = false;
    }  else if (IsInterstisialsAdReady == false && IsInterstisialsAdLoading== false ) {
        GoogleMobileAd.LoadInterstitialAd ();
    }

}

The Result in Log :

Init :
03-12 21:26:17.325: D/AndroidNative(21184): New interstitial unit id:  ******************************
03-12 21:26:17.345: I/Unity(21184): AN: Using proxy for class: com.androidnative.gms.ad.ANMobileAd method:Bridge_LoadInterstitialAd
03-12 21:26:26.540: D/AndroidNative(21184): InterstitialAd Is Test Device: true
03-12 21:26:33.970: D/AndroidNative(21184): OnInterstitialAdLoaded:

Click on Button to show an a first ads :
03-12 21:26:40.920: I/Unity(21184): InterstitialLoading = False
03-12 21:26:40.920: I/Unity(21184): InterstitialReady = True
03-12 21:26:40.925: I/Unity(21184): AN: Using proxy for class: com.androidnative.gms.ad.ANMobileAd method:Bridge_ShowInterstitialAd
03-12 21:26:40.940: D/AndroidNative(21184): OnInterstitialAdOpened:

Click on Button to show an a second ads :
03-12 21:27:05.660: I/Unity(21184): InterstitialLoading = False
03-12 21:27:05.660: I/Unity(21184): InterstitialReady = False
03-12 21:27:05.660: I/Unity(21184): AN: Using proxy for class: com.androidnative.gms.ad.ANMobileAd method:Bridge_LoadInterstitialAd
03-12 21:27:05.665: D/AndroidNative(21184): InterstitialAd Is Test Device: true
03-12 21:27:05.675: W/Ads(21184): An interstitial is already loading. Aborting.

And then nothing, because of the last line. Any help is very welcome !

Thanks !



Message has been deleted

Clement Vitroly

unread,
Mar 12, 2018, 5:04:06 PM3/12/18
to Google Mobile Ads SDK Developers
One more thing I doscover just right now, I saw on a post, the error "An interstitial is already loading. Aborting." can be trigger also when a ads is not yet closed.
And with mediation the event onInterstitalAdClosed is never trigger.

mobileadssdk-a...@google.com

unread,
Mar 13, 2018, 1:39:30 AM3/13/18
to Clement Vitroly, Google Mobile Ads SDK Developers
Hi there,

This seems like an implementation issue on your end.

I would like to point out that the message you described should only show when another Ad Request for an Interstitial Ad is still pending and has not yet received a response. Judging from your code snippet and your logs, it seems like this is the case. It is also possible that the Ad Request returned an error.

I also noticed that you are using your own flag to check if the Interstitial Ad is ready to be shown. This may cause issues depending on your implementation. I would suggest that you replace your IsInterstisialsAdReady variable and check if the Interstitial Ad is ready via .IsLoaded().

That said, can you check if you are receiving any errors from the OnAdFailedToLoad callback? Can you also check if you can replicate the issue on our sample apps? If possible, can you also provide to us a sample project/code snippet further showing your implementation? You may provide to us these information using the Reply Privately to Author option.

Regards,
Joshua Lagonera
Mobile Ads SDK Team

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/737da57a-9ee9-4ea3-ae7a-1fde2d1dd9ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Clement Vitroly

unread,
Mar 13, 2018, 4:11:04 AM3/13/18
to Google Mobile Ads SDK Developers
Hi,
Thanks for your answer. I finaly found the issue. With Unity ads mediation you don't have to initialize Unity, its an automated process, so by initializing Unity ads in my code, the create the issue.
I delete this part of code, then the event onInterstitalAdClosed is triggered and everything work fine now.

I want to clarify something from you answer, you told me


 "I would like to point out that the message you described should only show when another Ad Request for an Interstitial Ad is still pending and has not yet received a response. Judging from your code snippet and your logs, it seems like this is the case. It is also possible that the Ad Request returned an error."

But I think I avoid this by using "IsInterstisialsAdReady" need to be true to display an ads. And this become true only when an ad successfully loaded (by the event onInterstitalAdLoaded )

Thanks !
Reply all
Reply to author
Forward
0 new messages