Firebase analytics events don't show value

2019-04-04 12:59发布

问题:

I have a game and I want to send event every time user sets new high score, I check if current score is > that previous and if it is I send that new high score to firebase. code:

Bundle bundle = new Bundle();
bundle.putLong(FirebaseAnalytics.Param.LEVEL, extras.getInt("score"));
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.LEVEL_UP, bundle);

This is how it looks like in firebase console: image link

You can see how events are grouped by their value.

Problem is that i have 4 different modes and I want to capture high scores for each, so this is how I tried that:

Bundle bundle = new Bundle();
bundle.putLong(FirebaseAnalytics.Param.LEVEL, extras.getInt("score")); 
mFirebaseAnalytics.logEvent("mode4level", bundle);

And this is what I get in firebase console: image link

Grouped events by value are missing, I have only Event Location, Event demographics, Events per session.

How can I fix that, key part of analytics is missing ? Thank you.

回答1:

Reporting on parameters is limited to a subset of suggested events such as the LEVEL_UP event you mentioned. You can find more information in this thread.

Technically, you could register a user property like "game_mode" and setting the value of this before you log LEVEL_UP. Then you could filter your LEVEL_UP event reporting using the filter game_mode=. We don't generally recommend doing this since user properties are meant to be used for attributes of your users that do not change often. However, it may suit your needs here.

Alternatively, you can just add a "game_mode" parameter to the LEVEL_UP event and then link your app to BigQuery to analyze your raw data to get a breakdown of levels per game mode.



回答2:

I have same problem, and after reading documentation I found this:

https://firebase.google.com/docs/analytics/android/events#log_events

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.



回答3:

As of May 2017, custom parameter reporting is now supported in Google Analytics for Firebase. Please refer to this help center article for more details.