简体   繁体   English

如何使用 Fabric 的 Answers 或 Google Analytics 获取当前 Android 用户的事件计数?

[英]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:我有一个应用程序将自定义事件记录到 Fabric 的答案中,如下所示:

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 ?使用应用程序的 Answers API,是否可以查询当前用户此事件的总发生次数?

If not possible with Answers, is it possible with Google Analytics for Firebase ?如果使用 Answers 无法实现,是否可以使用 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.看来这现在需要使用 Firebase Analytics 来完成,而不是 Firebase 中的新 crashlytics。

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.我将其迁移到 Firebase Analytics 的方式是使用以下代码。

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以下是转换为 Firebase Analytics 的 Fabric 术语列表

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Android Studio中使用Fabric获取特定用户的时间轴并查看其推文? - How to get a specific user's timeline and view their tweets by using fabric in android studio? 如何通过twitter的Fabric API(Android)获取用户数据 - How to get user data through twitter's Fabric API (Android) 如何使用Google Fit的API获取用户当前的速度? - How to get the user's current speed using Google Fit's API? Google Analytics(分析)错误的用户数 - Google Analytics incorrect user count 如何通过使用Google Maps获取用户当前位置并在android中放置标记 - How can i get the user current location and put marker on it in android by using google maps 如何使用Google Analytics for Android跟踪用户首选项? - How to track user preferences with Google Analytics for Android? 如何在Android上使用Google Analytics(分析)用户计时 - How to use google analytics user timings on android 如何在不影响会话数的情况下触发Google Analytics(分析)事件? - How to fire a Google Analytics event without impacting session count? 如何使用Android中的Google Maps Api获取手机的当前位置? - How to get my phone's current location using Google Maps Api in Android? 如何在Android中使用Facebook SDK获取当前用户的生日和电话号码 - how do I get the current user's birth-day and phone number using facebook sdk in android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM