问题描述
我有一个使用Firebase SDK的应用程序,并使用了一些预定义的事件和参数,但是会自动添加一些参数,但不是所有参数
I have application which use Firebase SDK and used some predefined event and parameters but some parameters are automatically added but not all parameters
例如添加到购物车事件"
For example Add to cart event
Android:
bundle.putString(FirebaseAnalytics.Param.ITEM_CATEGORY, params.get("item_category").toString());
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, params.get("item_name").toString());
bundle.putString(FirebaseAnalytics.Param.ITEM_LOCATION_ID, params.get("item_location_id").toString());
bundle.putString(FirebaseAnalytics.Param.CURRENCY, params.get("currency").toString());
bundle.putDouble(FirebaseAnalytics.Param.VALUE, ((Number) params.get("value")).doubleValue());
bundle.putString(FirebaseAnalytics.Param.COUPON, params.get("coupon").toString());
bundle.putString(FirebaseAnalytics.Param.ITEM_ID, params.get("item_id").toString());
bundle.putLong(FirebaseAnalytics.Param.QUANTITY, ((Number) params.get("quantity")).longValue());
this.firebaseAnalytics.logEvent(FirebaseAnalytics.Event.ADD_TO_CART, bundle);
IOS
[FIRAnalytics logEventWithName:kFIREventAddToCart parameters:@{
kFIRParameterItemCategory:[parameters valueForKey:@"item_category"],
kFIRParameterItemName:[parameters valueForKey:@"item_name"],
kFIRParameterItemLocationID:[parameters valueForKey:@"item_location_id"],
kFIRParameterCurrency:[parameters valueForKey:@"currency"],
kFIRParameterValue:[parameters valueForKey:@"value"],
kFIRParameterCoupon:[parameters valueForKey:@"coupon"],
kFIRParameterItemID:[parameters valueForKey:@"item_id"],
kFIRParameterQuantity:[parameters valueForKey:@"quantity"]
}];
在信息中心中,我们只能看到item_name和value.请帮助....在此先感谢
In dashboard, We can see only item_name and value. please help.... thanks in advance
推荐答案
我假设您的 params 对象是具有相似值的组合数组
I'm supposing that your params object is a composed array with the similar values
{
"item_category" : "t-shirts",
"item_name" : "abc",
"item_location_id" : "ChIJiyj437sx3YAR9kUWC8QkLzQ",
"currency" : "USD",
"value" : 3.99,
"coupon" : "zz123",
"item_id" : "p7654",
"quantity" : 1
}
如果是这种情况,那么您将以正确的方式来创建事件.但是,您尝试在Firebase控制台的 Parameter Reporting (参数报告)部分中查看事件值.我根据您附上的图片进行了分析.
If that is the case then you are in the right way to create the event. But you are trying to see the event values in the Parameter Reporting section in the Firebase Console. I analysed based on the image you attached.
如果要查看事件值,我建议单击事件名称而不是选项卡 Parameter Reporting (事件报告)来检查事件仪表板报告,请遵循以下,它向您展示了如何在仪表板控制台中组织Firebase事件的示例.
If you want to see the event values I recommend check the event dashboard report by clicking on the event name instead of the tab Parameter Reporting, follow this link, it shows you an example of how Firebase Events are organized in the Dashboard Console.
希望对您有帮助.
这篇关于Android Firebase Analytics:预定义和自定义参数不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!