Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to view Bundle Parameter in Firebase Event Analytics

I have a unique button in 4 different fragments. These unique buttons do similar stuff in all of these fragments, but with a little tweak.

Since all of these things are similar, i log them together under the event name "unique_btn_click_event"

val eventName = "unique_btn_click_event"
val eventBundle = Bundle()

eventBundle.putString("fragment_name", fragmentName)
eventBundle.putString("unique_stuff_1", uniqueStuff1)
eventBundle.putString("unique_stuff_2", uniqueStuff2)
eventBundle.putString("qty_selected", quantity)

FirebaseAnalytics.getInstance(context).logEvent(eventName, eventBundle)

My Objective is to measure which fragment uses the unique button the most, so that i can optimize for that and possibly deprecate others.

Although the event unique_btn_click_event, gets logged but i can not see the history of bundle parameter that i have logged. I click on the fab_actions event:

enter image description here

In the next page that appears, there is no place where i can view these bundles, even by number of count.

The closest i get is: StreamView : Which is designed to show only real time bundle data. Real time is cool, but it can not be used to make quality decision.

I click on Stream View.

enter image description here

I click on Trending then Events

enter image description here

I see a list of realtime bundle log data.

enter image description here

How can i view action count of log history.

How can i nest events.

like image 483
LekeOpe Avatar asked Oct 15 '22 08:10

LekeOpe


1 Answers

In order to see your event parameters custom metrics on the Firebase Analytics Dashboard, you need to add them in your events. This Link will give you the steps you need to follow to add the event parameters custom metrics: Add Custom Dimensions and metrics in Firebase Analytics Reporting

To summarize the steps:

  1. Go to Custom Definitions menu under Analytics section on the Firebase Analytics dashboard
  2. Here, you will see 2 tabs: Custom dimensions and Custom metrics. Just to give an overview, custom dimensions are similar to user properties and custom metrics are similar to event parameters if you have worked with Firebase Analytics before. What has changed is that Firebase has now added a filter called Scope inside custom definitions and metrics that will determine whether to use user properties or event parameters to track the data.
  3. Select Custom metrics if you want to work only with event parameters (as of the time of this writing). If you want to work with user properties, then select Custom dimensions as here you can select both scopes.
  4. For adding new user properties/event parameters, click on Create custom dimensions (if you have selected Custom definitions) or Create custom metrics (if you have selected Custom metrics).
  5. In the next window, enter your Dimension/Metric name (depending on what you have selected in the previous step), Description, Scope (only available for Custom dimensions).
  6. If the scope is Event, then you can only set Event parameter and if the scope is User, then you only select User property. In our case, we have to work with event parameters so the scope should be Event.
  7. If you have created a custom metric, then you will also get an option to set the Unit of measurement. As of now, we have the following options:
    • Standard (No Unit)
    • Currency
    • Distance (Feet, Miles, Meters, Kilometers)
    • Time (Milliseconds, Seconds, Minutes, Hours)
  8. If you have already added user properties and event parameters before, then you can select those from the dropdown list. Otherwise, you can type your own user property/event parameter that you will use in the future.
  9. Once Done, click on Save and your parameter reporting should be up and running.

In order to see the list of parameters used in your events, you need to select the Parameter Reporting tab next to the Events tab on the Analytics Dashboard.

Once you have enough tracked data, you will see the values of the event parameters on the Events page itself.

As for getting real-time event-tracking, you need to use Debug View to track your events in real-time. In order to enable debugging in Firebase Analytics for Android, you need to run the following commands using ADB:

Enable Debugging in IDE

adb shell setprop log.tag.FA VERBOSE

Enable Debugging in Debug View of Firebase Analytics

adb shell setprop debug.firebase.analytics.app <your_app_package_name>

NOTE: Substitute <your_app_package_name> (without the <>) with the package name of your application. Example: com.example.uniquepackagename

You will get the log of your event action count in the Existing events table in the Events section as mentioned above.


Lastly, for nesting events, I don't think Firebase Analytics currently supports that directly. However, you can use Custom User properties in your application to group the events by a User Property. User properties can be used as filters to filter events by a user property. Here is a link to get you started on User Property: Work with User Properties in Firebase

After setting the user properties in your Android app, you need to add them in the Firebase Analytics dashboard as well. I have already covered this in the steps mentioned above. The name of the user property needs to be exactly the same as the name you are using in your app.

NOTE: Once you set a user property, it will persist in further events that you send even if you don't set it explicitly. So be careful while setting user properties as you may not need them in some events.

I hope this helps you in your issue with events in Firebase Analytics.


EDIT: It seems Google has updated the Firebase console. Now we have custom definitions (GA4) instead of user properties and inside that we have custom definitions and metrics, which is similar to the old Google Analytics tracking.

I have updated my above answer in places that were outdated. I have striken some words from my previous answer in a few places so that in case you are coming from the old Firebase Analytics implementation, you will know where the changes were made.

Please check and hope it helps.

Regards,

Aj

like image 165
AJ7 Avatar answered Oct 27 '22 01:10

AJ7