BlazeCodeDev
BlazeCodeDev

Reputation: 999

Firebase Analytics custom event average value

How can I set up FB Analytics in a way that it calculates the average value of a specific custom event? I'm using it on Android. This is the code of the custom event log:

public void logLevel(int level){
    Bundle params = new Bundle();
    params.putInt("user_level", level);
    mFirebaseAnalytics.logEvent("user_level", params);
}

If the app sends level 10 from one device and level 20 from another one I want firebase to display avg level 15. Is that possible?

Upvotes: 1

Views: 751

Answers (1)

looptheloop88
looptheloop88

Reputation: 3800

I think that way you're logging the event and its parameter is correct. Once your event is visible in the Event page of Firebase console, add the parameter in reporting. Make sure to select the right data type, which is Number for your case.

Keep logging the data and you should be able to see similar to this:

enter image description here

This is the score parameter of post_score event in the Firebase demo project. Check it out.

Upvotes: 3

Related Questions