Compare commits

..

No commits in common. "c844ffcf2938860a18a282f33c4dfb6d01a668c9" and "c0c2c0b61e61dc1b26f2bbd1b671d2a764a8b8b4" have entirely different histories.

2 changed files with 9 additions and 30 deletions

View File

@ -54,11 +54,8 @@ namespace WZ
};
bannerAds.OnBannerAdLoadFailed += ((msg) =>
{
if (!_retryCounters.TryAdd(adUnitId, 0))
{
_retryCounters[adUnitId]++;
}
double retryDelay = Math.Pow(2, Math.Min(6, _retryCounters[adUnitId]));
LoggerUtils.Debug($"[Admob] banner -[Load]: {adUnitId} failed, error message = {msg}");

View File

@ -49,32 +49,17 @@ namespace WZ
{
_retryCounters[adUnitId]++;
}
var adSource = "";
if (ad != null)
{
adSource = ad.GetResponseInfo().GetLoadedAdapterResponseInfo().AdSourceName;
}
var reason = "";
if (error != null)
{
reason = error.GetMessage();
}
AdsActionEvents.TrackAdFailToLoad(PlatformType.Admob,
adSource,
ad.GetResponseInfo().GetLoadedAdapterResponseInfo().AdSourceName,
adUnitId,
AdsType.Native,
Time.realtimeSinceStartup - _adStartLoadTimes[adUnitId], reason);
Time.realtimeSinceStartup - _adStartLoadTimes[adUnitId],error.GetMessage());
var retryDelay = Math.Pow(2, Math.Min(6, _retryCounters[adUnitId]));
TimerUtils.Instance.DelayExecute((float)retryDelay, () => { LoadAd(adUnitId); });
LoggerUtils.Debug("[Admob] Native ad failed to load an ad with error : " + error + " \n retryDelay :" + retryDelay);
return;
}
AdsActionEvents.TrackAdLoaded(PlatformType.Admob,
ad.GetResponseInfo().GetLoadedAdapterResponseInfo().AdSourceName,
adUnitId,
@ -112,16 +97,14 @@ namespace WZ
ad.OnAdFullScreenContentOpened += () => { LoggerUtils.Debug("[Admob] Native ad full screen content opened."); };
ad.OnAdFullScreenContentClosed += () =>
{
ad.OnAdFullScreenContentClosed += () => {
AdsActionEvents.TrackAdClicked(PlatformType.Admob,
ad.GetResponseInfo().GetLoadedAdapterResponseInfo().AdSourceName,
adUnitId,
AdsType.Native,
"",
AdmobUtils.GetNativeEcpm(ad));
LoggerUtils.Debug("[Admob] Native ad full screen content closed.");
};
LoggerUtils.Debug("[Admob] Native ad full screen content closed."); };
});
}
@ -173,7 +156,6 @@ namespace WZ
{
return _adStartLoadTimes.TryGetValue(adUnitId, out var time)? time : 0;
}
// 检查特定广告位是否可用
public bool IsAdAvailable(string adUnitId)
{