gpt4 book ai didi

java - onAdImpression() 未在 Admob 监听器中调用

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:52:59 25 4
gpt4 key购买 nike

在横幅广告中 onAdImpression() 不再被调用。

 mAdview = findViewById(R.id.bannertest);
mAdview.setAdListener(new AdListener() {
@Override
public void onAdClosed() {
super.onAdClosed();
Log.w(TAG, "onAdClosed: ");
}

@Override
public void onAdFailedToLoad(int i) {
super.onAdFailedToLoad(i);
Log.w(TAG, "onAdFailedToLoad: ");

}

@Override
public void onAdLeftApplication() {
super.onAdLeftApplication();
Log.w(TAG, "onAdLeftApplication: ");
}

@Override
public void onAdOpened() {
super.onAdOpened();
Log.w(TAG, "onAdOpened: ");
}

@Override
public void onAdLoaded() {
super.onAdLoaded();
Log.w(TAG, "onAdLoaded: ");
}

@Override
public void onAdClicked() {
super.onAdClicked();
Log.w(TAG, "onAdClicked: ");
}

@Override
public void onAdImpression() {
super.onAdImpression();
Log.w(TAG, "onAdImpression: ");
}
});
mAdview.loadAd(new AdRequest.Builder().build());

有什么方法可以跟踪横幅广告的印象吗?

最佳答案

引用:https://developers.google.com/android/reference/com/google/android/gms/ads/mediation/MediationNativeListener#onAdImpression(com.google.android.gms.ads.mediation.MediationNativeAdapter)

public abstract void onAdImpression (MediationNativeAdapter adapter)

表示已为广告记录一次展示。此方法应仅 be called if setOverrideImpressionRecording(boolean) is set to true .这用于发布商指标,并且必须在任何其他事件之外调用。

阅读更多 https://developers.google.com/android/reference/com/google/android/gms/ads/mediation/MediationNativeListener#onAdImpression(com.google.android.gms.ads.mediation.MediationNativeAdapter)

编辑2

https://developers.google.com/android/reference/com/google/android/gms/ads/mediation/NativeAdMapper

编辑3

An impression simply says that the ad is present so the onAdLoaded is where you would want to place your impression tracking.

关于java - onAdImpression() 未在 Admob 监听器中调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50355792/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com