Firebase Analytics custom events params

2019-01-01 15:39发布

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

6条回答
骚的不知所云
2楼-- · 2019-01-01 15:57

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.

查看更多
看淡一切
3楼-- · 2019-01-01 15:58

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

查看更多
像晚风撩人
4楼-- · 2019-01-01 16:11

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

查看更多
闭嘴吧你
5楼-- · 2019-01-01 16:13

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

查看更多
浪荡孟婆
6楼-- · 2019-01-01 16:15

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

查看更多
听够珍惜
7楼-- · 2019-01-01 16:17

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.

查看更多
登录 后发表回答