简体   繁体   中英

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

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 ?

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

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM