![]() |
Mobile Ads SDK Team |
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.
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