问题描述
我已经看到关于firebase analytics的自定义事件的一些问题和答案,但我只是想问你一个直接的问题,所以你可以给我一个直接的答案:)
@Override
public void logFeatureSelectedEvent(String categoryName,String actionName,String labelName){
Bundle bundle = new Bundle();
bundle.putString(EventTrackingKeys.EventTypes.CATEGORY,categoryName);
bundle.putString(EventTrackingKeys.EventTypes.ACTION,actionName);
bundle.putString(EventTrackingKeys.EventTypes.LABEL,labelName);
mFirebaseAnalytics.logEvent(EventTrackingKeys.EventAnalyticTypes.FEATURE_SELECTED_EVENT,bundle);
$ / code $ / pre
自定义事件/密钥名称:
String CATEGORY =category;
String ACTION =action;
String LABEL =label;
String FEATURE_SELECTED_EVENT =feature_selected_event;因此,在我的Firebase控制台中,我只获取事件名称feature_selected_event,没有自定义参数名称。
我见过一些答案,我应该调用setUserProperty()方法,并在Firebase Analytics的用户属性选项卡中注册该用户属性。
这是实现该方法的正确方法吗? :
$ @ $ b $ public void logFeatureSelectedEvent(String categoryName,String actionName,long value){
Bundle bundle = new Bundle();
bundle.putString(EventTrackingKeys.EventTypes.CATEGORY,categoryName);
bundle.putString(EventTrackingKeys.EventTypes.ACTION,actionName);
bundle.putLong(EventTrackingKeys.EventTypes.VALUE,value);
mFirebaseAnalytics.setUserProperty(EventTrackingKeys.EventTypes.CATEGORY,categoryName);
mFirebaseAnalytics.setUserProperty(EventTrackingKeys.EventTypes.ACTION,actionName);
mFirebaseAnalytics.setUserProperty(EventTrackingKeys.EventTypes.VALUE,value);
mFirebaseAnalytics.logEvent(EventTrackingKeys.EventAnalyticTypes.FEATURE_SELECTED_EVENT,bundle);
解决方案自定义参数不会所示。在仪表板中仅显示带建议参数的建议事件。
要查看自定义参数,您必须将项目链接到Big Query(它不是免费的)。
如果用户数量少于10,Firebase将不会显示信息。
I've seen some questions and answers about custom events for firebase analytics, but i just wanted to ask you a straight question so you can give me a straight answer :)
So, this is my method for logging:
@Override
public void logFeatureSelectedEvent(String categoryName, String actionName, String labelName) {
Bundle bundle = new Bundle();
bundle.putString(EventTrackingKeys.EventTypes.CATEGORY, categoryName);
bundle.putString(EventTrackingKeys.EventTypes.ACTION, actionName);
bundle.putString(EventTrackingKeys.EventTypes.LABEL, labelName);
mFirebaseAnalytics.logEvent(EventTrackingKeys.EventAnalyticTypes.FEATURE_SELECTED_EVENT, bundle);
}
with custom event/key names:
String CATEGORY = "category";
String ACTION = "action";
String LABEL = "label";
String FEATURE_SELECTED_EVENT = "feature_selected_event";
So, in my firebase console I only get event name "feature_selected_event", without custom parameter names..I've seen some answers that i should call setUserProperty() method and register that user property in the User Properties tab of Firebase Analytics.Is this the right way to implement that method? :
@Override
public void logFeatureSelectedEvent(String categoryName, String actionName, long value) {
Bundle bundle = new Bundle();
bundle.putString(EventTrackingKeys.EventTypes.CATEGORY, categoryName);
bundle.putString(EventTrackingKeys.EventTypes.ACTION, actionName);
bundle.putLong(EventTrackingKeys.EventTypes.VALUE, value);
mFirebaseAnalytics.setUserProperty(EventTrackingKeys.EventTypes.CATEGORY, categoryName);
mFirebaseAnalytics.setUserProperty(EventTrackingKeys.EventTypes.ACTION, actionName);
mFirebaseAnalytics.setUserProperty(EventTrackingKeys.EventTypes.VALUE, value);
mFirebaseAnalytics.logEvent(EventTrackingKeys.EventAnalyticTypes.FEATURE_SELECTED_EVENT, bundle);
}
解决方案 The custom parameters will not be shown. Only suggested events with suggested parameters are presented in dashboard.
To see the custom parameters, you have to link your project to Big Query (it's not free).
Also Firebase will not show information if the number of user is less than 10.
这篇关于如何为分析添加Firebase自定义事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!