Request: For AdListener of AdView, also provide a callback of "onStartedAdLoading"

70 views
Skip to first unread message

Liran Barsisa

unread,
Aug 1, 2023, 10:24:31 AM8/1/23
to Google Mobile Ads SDK Developers
On the first time that I use AdView, I can measure the duration it takes to load the first ad or getting an error, using callbacks of "onAdLoaded" and "onAdFailedToLoad".

https://developers.google.com/android/reference/com/google/android/gms/ads/AdListener

However, after that, as AdView automatically refreshes (based on setting on the AdMob website), it's impossible, as I can't know when it started to load.

Please offer a new callback in the com.google.android.gms.ads.AdListener abstract class, of "onStartedAdLoading", which means that it started to load a new ad.

Mobile Ads SDK Forum Advisor

unread,
Aug 1, 2023, 3:14:50 PM8/1/23
to lbl...@gmail.com, google-adm...@googlegroups.com
Hello Liran,

Thank you for reaching out to us.

Before we can share this information to the wider team for a possible feature request, would you kindly explain this feature in more detail?
 
This message is in relation to case "ref:_00D1U1174p._5004Q2nZmrz:ref"

Thanks,
 
Google Logo Mobile Ads SDK Team


Liran Barsisa

unread,
Aug 3, 2023, 11:40:14 AM8/3/23
to Google Mobile Ads SDK Developers

It's just as I said. It's an extra callback.
We have it for error and success, but not for start:

This would help measure how long it takes to load ads, just as it's possible for native ads.
Maybe can be useful for other purposes too.

Mobile Ads SDK Forum Advisor

unread,
Aug 3, 2023, 3:34:53 PM8/3/23
to lbl...@gmail.com, google-adm...@googlegroups.com

Hi Liran,

Thank you for your response.

We have raised a feature request for this to become available in Mobile Ads SDK. Kindly note this will be subject for review. What we can do is to advise you to keep an eye on our blog for any future updates on this: https://ads-developers.googleblog.com/search/label/admob.

Mobile Ads SDK Forum Advisor

unread,
Mar 13, 2024, 12:25:22 PM3/13/24
to lbl...@gmail.com, google-adm...@googlegroups.com

Hi Liran,

To close the loop here, we don't plan to offer an onStartedAdLoading() callback. Here are some workarounds to achieve what you want to achieve for capturing banner load times:

1. Turn off auto-refresh and manually load ads every time, and start timer when you call loadAd(). I understand this probably doesn't meet your requirements.
2. Look at https://developers.google.com/android/reference/com/google/android/gms/ads/AdapterResponseInfo#getLatencyMillis() from the ResponseInfo object that's available when the ad loads (https://developers.google.com/admob/android/response-info#response_info). This can give you some idea of how long it took each adapter in the waterfall to get called and render the ad. Note that I don't think this is a perfect proxy for what you want, as it mainly captures render time for each network, not the initial request to Google ad server to get the ad html or the mediation chain.
3. Hardcode the refresh rate in your app, and track time between onAdLoaded() calls. The time between ad load calls minus the refresh rate is an approximation of how long it took to load the ad. Note that this data could become less useful in the future if we explore trying to load ahead of your refresh rate to get an ad ready closer to your actual refresh time.

It would help to understand why you want to track this. If the goal is to achieve the true refresh rate, you may want to implement option 1 and just load 2 ads and have one ready to rotate at your preferred refresh rate.

Thanks,
Eric, Mobile Ads SDK Team



ref:!00D1U01174p.!5004Q02nZmrz:ref

Liran Barsisa

unread,
Mar 14, 2024, 5:39:06 AM3/14/24
to Google Mobile Ads SDK Developers
So instead of using what we already have of automatic refreshing of new ads, and minimize code in the process, you want me to re-implement what AdView already has, and load ads manually on my own, just to have a callback for when it starts to get a new ad?
How so?
Please just have a new callback function. Surely it's much easier than what you wrote here ...
Reply all
Reply to author
Forward
0 new messages