I’m trying to log Admob’s onPaidEvent() callback’s for impression-level ad revenue, according to this documentation.
I’m using Firebase’s Events for this matter, so I made this straightforward logging:
@Override
public void onPaidEvent(@NonNull AdValue adValue) {
long valueMicros = adValue.getValueMicros();
String currencyCode = adValue.getCurrencyCode();
String adUnitId = rewardedAd.getAdUnitId();
int precisionCode = adValue.getPrecisionType();
AdapterResponseInfo adapterResponseInfo = rewardedAd.getResponseInfo().getLoadedAdapterResponseInfo();
if (adapterResponseInfo != null) {
String adSourceName = adapterResponseInfo.getAdSourceName();
String precision = "UNDEFINED_TODO";
if (precisionCode == AdValue.PrecisionType.PRECISE) {
precision = "Precise";
} else if (precisionCode == AdValue.PrecisionType.ESTIMATED) {
precision = "Estimated";
} else if (precisionCode == AdValue.PrecisionType.UNKNOWN) {
precision = "Unknown";
} else if (precisionCode == AdValue.PrecisionType.PUBLISHER_PROVIDED) {
precision = "Publisher provided";
}
Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.ITEM_ID, adUnitId);
bundle.putString(FirebaseAnalytics.Param.CURRENCY, currencyCode);
bundle.putLong(FirebaseAnalytics.Param.VALUE, valueMicros);
bundle.putString("ad_precision", precision);
bundle.putString(FirebaseAnalytics.Param.AD_SOURCE, adSourceName);
FirebaseAnalytics.getInstance(act).logEvent(FirebaseAnalytics.Event.ADD_PAYMENT_INFO, bundle);
} else {
FirebaseCrashlytics.getInstance().recordException(new Exception("AdapterResponseInfo is NULL in onPaidEvent(), this is a problem."));
}
}
My problem is that even that I see my ADD_PAYMENT_INFO parameter in Firebase Events, it does not have any parameters attached, see below:
The event is there, “add_payment_info” but the parameter list is completely empty, I don’t see any of the logged parameters, like currency, or anything else.
I also have:
FirebaseAnalytics.getInstance(this).setAnalyticsCollectionEnabled(!BuildConfig.DEBUG);
In my application class, and I did test the application from Google Play, so this one should be okay.
Also I don’t see any recorded exception or anything which would suggest that something is going sideways, whenever I test this thing in Firebase DebugView, I do see the parameters sent very well.
How is this possible, what am I doing wrong?
Thanks in advance.