How to get the event count for the current Android user using Fabric's Answers or Google Analytics?

。_饼干妹妹 提交于 2020-07-23 10:20:06

问题


I have an app logging a custom event into Fabric's Answers as follows:

Answers.getInstance().logCustom(new CustomEvent("AnEvent");

Using Answers API for apps, is it possible to query the total number of occurences of this event for the current user ?

If not possible with Answers, is it possible with Google Analytics for Firebase ?


回答1:


I had run into the same problem. It appears this will now need to be done with Firebase Analytics and not the new crashlytics within Firebase.

I previously was logging when a user got a new level in my game with the following code.

var levelName : String = "level 2"
Answers.getInstance().logLevelStart(LevelStartEvent().putLevelName(levelName)

The way I have migrated this to Firebase Analytics is with the following code.

var firebaseAnalytics : FirebaseAnalytics = FirebaseAnalytics.getInstance(activity)
val params = Bundle()
params.putString(FirebaseAnalytics.Param.ITEM_NAME, "Level " + Game.State.gameLevel)
firebaseAnalytics.logEvent(LEVEL_START, params)

Below is the list of Fabric terms translate to Firebase Analytics



来源:https://stackoverflow.com/questions/60193763/how-to-get-the-event-count-for-the-current-android-user-using-fabrics-answers-o

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!