Firebase Analytics custom events params

AndroidEventsFirebaseFirebase Analytics

Android Problem Overview


I am completely new to Firebase analytics. I am trying to send an event which shows statistics about my API call.

endTime = System.currentTimeMillis() - startTime;

// [START event]
Bundle params = new Bundle();
params.putString(FirebaseConstants.PHONE_NUMBER, Utility.getPhone());
params.putLong(FirebaseConstants.DURATION, endTime);
FirebaseAnalytics
            .getInstance(getContext())
            .logEvent(FirebaseConstants.BALANCE_CHECK, params);
// [END event]

But I only see the name of the event, number of users and occurrence count. 24 hours have already passed and I don't see my custom properties. For reference, I want to see a phone number(Utility.getPhone()) and the time which API call takes(endtime). Maybe it is possible that it does not send anything because I created custom params in my FirebaseConstans class

Android Solutions


Solution 1 - Android

[Update, May 2017]

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.

Solution 2 - Android

your custom data and parameters will be available as soon as your audience reach 10 or more, that is a privacy restriction. so just use it in your activity as:

FirebaseAnalytics mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
Bundle bundle = new Bundle();
bundle.putString("some_key", "some_value");
mFirebaseAnalytics.logEvent("some_name", bundle);

it will work (after some time (max 24 hrs) you can see some_name as event in your event view but some_key will be available when audience is 10 or more).

Solution 3 - Android

As of https://support.google.com/firebase/answer/7397304?hl=en&ref_topic=6317489, you need to register your parameters before they can be shown

> When you first set up custom parameters, a data card for it will be added to your event detail report. However, it may take up to 24 hours for any data to appear.

enter image description here

Solution 4 - Android

According to documentation, you have to link with BigQuery to see custom parameters:

> 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.

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

Solution 5 - Android

I have contacted firebase support and got response:

> Looks like the params don't pre-populate automatically. When creating > your audience, you'll have to fill them in yourself.

The thing is, data will be populated only with events coming AFTER creating new audience, you won't get data collected until that moment, which is something I would expect to be the case...

Edit: from firebase support personel > Audiences are not retroactive, so you will indeed need to create them before data will be populated within them. Do note that existing data can still be looked at and queried if linked with BigQuery. Also keep in mind that most audiences will have a minimum threshold which needs to be met before reports are generated for them.

Solution 6 - Android

From 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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRustam IbragimovView Question on Stackoverflow
Solution 1 - AndroidSteve GanemView Answer on Stackoverflow
Solution 2 - AndroidDmila RamView Answer on Stackoverflow
Solution 3 - Androidonmyway133View Answer on Stackoverflow
Solution 4 - AndroidhidroView Answer on Stackoverflow
Solution 5 - AndroidPiafView Answer on Stackoverflow
Solution 6 - AndroidmichgauzView Answer on Stackoverflow