用于游戏的 Firebase Analytics(测量每个级别的时间)

Firebase Analytics for games (measure time on each level)

我正在开发游戏,我想访问 "which level is the most difficult?" 或 "how much time does a user spend on average in easy difficulty and how much on normal difficulty?" 等信息。

Firebase Analytics 似乎可以解决这个问题,但我不确定是否必须使用预定义或自定义事件和参数。

目前,当用户完成一个级别时,我会记录以下事件:

Bundle bundle = new Bundle();
bundle.putString("difficulty", levelDifficulty); //easy, normal, advanced, etc.
bundle.putString(FirebaseAnalytics.Param.LEVEL, levelName); //the name or index of the level, for example "Level 1"
bundle.putLong(FirebaseAnalytics.Param.VALUE, duration); //seconds passed to complete the level
analytics.logEvent("level_ended", bundle);

a) 我能通过那个简单的事件获得我需要的信息吗?

b) 我必须使用预定义事件还是自定义事件?同样,我是否必须对该事件使用预定义或自定义参数?

c) 如果我使用任何自定义事件或自定义参数,Firebase 会自动收集这些事件还是我必须在 Firebase 控制台中注册这些自定义事件或这些自定义参数?

谢谢。

您可以使用自定义事件来执行此操作。按照 these instructions 进行设置。

您只有在export them to BigQuery进行分析时才能看到自定义事件的属性。您将无法在控制台中看到它们。