如果此处发布此问题的位置不正确,请提前接受我的歉意,因为我不确定会是什么。
我想要完成的是记录自定义,即使使用 Firebase 分析在 Firebase 控制台中生成与他们的 select_content
事件示例类似的报告。触发如下:
FirebaseAnalytics mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "ID");
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "NAME");
bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "image");
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
更具体地说,FirebaseAnalytics.Param.CONTENT_TYPE
之后的字符串可以是任何值,并将在控制台中生成报告,如下所示:
我创建自己的自定义事件:
Bundle params2 = new Bundle();
params2.putString(FirebaseAnalytics.Param.VALUE, "Google Play Games Sign out Button");
mFirebaseAnalytics.logEvent("Main_Activity_Button_Pressed", params2);
并且为下面显示的此事件生成的报告似乎没有考虑到我添加的值。
是否有可能完成我想要做的事情,如果可以,正确的方法是什么?
这解释了为什么我的自定义参数没有出现在控制台中。
最佳答案
我相信附加到自定义事件的任何参数都被视为自定义参数(即使您使用来自 FirebaseAnalytics.Param
类的参数),因此这些值不会根据 docs here 直接在您的报告中表示。 :
Custom parameters: Custom parameters are not represented directly in your Analytics reports, but they can be used as filters in audience definitions that can be applied to every report. Custom parameters are also included in data exported to BigQuery if your app is linked to a BigQuery project.
关于控制台中的 Android Firebase Analytics 自定义事件报告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37357605/