I want to log user search event to Firebase but the Search_Term param value in the Search event doesn't show up in the dashboard. Here my code:
Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.SEARCH_TERM, searchText);
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SEARCH, bundle);
I have tried to log different event with other param and the param value show up in dashboard correctly!
How can I fix this? Thank you
Currently the search data doesn't appear in the Firebase Analytics dashboard.
Your logging seems indeed correct. To see the data you can use Google BigQuery.
One thing you should do is to ensure that searchText is 36 characters or less, otherwise data will just appear as empty in Firebase (and BigQuery).
In general when struggling with data not appearing one should ensure that the logged events follows the possible combinations of events/parameters as described in https://support.google.com/firebase/answer/6317498 . Also notice that the Firebase Console doesn't show the data instantly after being logged (give it at least 30 minutes).
Update:
Firebase Analytics have later increased the maximum length of event names and parameter name to 40 characters, and the maximum length of string parameter values to 100 characters: https://firebase.google.com/support/release-notes/android#wzxhzdk4version_100_-_november_21_2016wzxhzdk5
Related
I have integrated Firebase Analytics in my project. I am logging around 10 different events. I can see all these events on the dashboard.
The issue is I am unable to see parameter values of the event.
Ex.
Bundle bundle = new Bundle();
bundle.putString(AppConstants.PARAM_USER_ID, getUserId());
bundle.putString(AppConstants.PARAM_OFFER_ID, itemDetails.getId());
bundle.putString(AppConstants.PARAM_OFFER_TITLE, itemDetails.getTitle());
FirebaseAnalytics mFirebaseAnalytics = FirebaseAnalytics.getInstance(activity);
mFirebaseAnalytics.logEvent("View_Item", bundle);
As per the above code, I can see the event named "View_Item" on the dashboard. But I can't see the details insight of each event's parameters like userId, item_id and offer title, etc.
Is there any way to see parameter values that?
Que 2. How long text parameter value can support?
Because I tried to log the event in Fabric with over 3k char. In this case, the content was getting cut and there no way to expand the full content in Fabric.
Is this same issue with Firebase?
I have 10 events which I am logging to Firebase Analytics. All 10 events have same 4 parameters named Category, Value, Action and Label.(All are text except value which is a int)
I see the logged events in Firebase Analytics under "Events". But I cannot see the value of parameters for each event. After some research i figured out that we have to add event parameters from the Firebase console. So i clicked on "Edit Parameter Reporting" and added the four parameters mentioned above which increased the value of Global parameters registered. Now i want to add the same parameters for all remaining 9 events but I cannot figure out a way to use the same global parameter in each event. When i started to add same parameters to all events separately by the time i was in my 4th event the limit(10) for text parameters exceeded.
In short: I want to use same 3 text parameters for all my 10 events. but registering 3 text parameters for all event separately exceeds the text param limit by the time I am at fourth event. I want to see these params value for all events. Please help. Here's how i am logging events:
public static void logAnalyticsEvent(Context context, String eventName, String category, String action, String label, int value){
FirebaseAnalytics firebaseAnalytics;
firebaseAnalytics = FirebaseAnalytics.getInstance(context);
Bundle bundle = new Bundle();
bundle.putString(AnalyticsConstants.Param.CATEGORY, category);
bundle.putString(AnalyticsConstants.Param.ACTION, action);
bundle.putString(AnalyticsConstants.Param.LABEL, label);
bundle.putInt(AnalyticsConstants.Param.VALUE, value);
firebaseAnalytics.logEvent(eventName,bundle);
}
The events logged by this are visible in Firebase Analytics under Events tab but clicking on event I am unable to see the value of the parameters.
I got around the issue of category and action by concatenating them to the event name.
ie settings_edit_pressed = (category)_(event name)_action
But at the end of the day you still need label to show differences in that action. You can't concatenate label because you'll have millions of events each named alert_input_xxxxx
So if you don't need label or value then hopefully this helps but this certainly isn't a good answer if you need dynamic changes :(
Apparently BigQuery might be another solution but I don't know if you have access to parameters that exceeded the global limits.
i've logged a firebase event using the code below in android (a long time ago).
mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
Bundle params = new Bundle();
params.putString(FirebaseAnalytics.Param.VALUE, String.valueOf(subjectvalue));
params.putString(FirebaseAnalytics.Param.CURRENCY, "IRR");
mFirebaseAnalytics.logEvent("Calculate_Cost_of_Hearing", params);
as you can see in this image the events are being logged and sent to firebase and shown separately but the value indicator still shows zero.
should i change my code in order to make it show the values or should i play with the options ? and my ultimate goal is to know the average values not just the SUM.
I am pretty sure that Value displays 0 because the parameter is bundled as a String. If you use params.putDouble() or putLong() instead of putString() the value should accumulate in the Firebase console.
You will not be able to display the average value per user in the event view since it shows only the accumulated value. If you want to work with the data you will have to connect your Firebase instance to BigQuery, pretty much.
Perhaps you could get the Value included in the "revenue per user" - metric on the Dashboard if you make the event count as revenue, but I have no experience doing that.
When my apps starts, asks a question to the user. I save the event like this:
Bundle bundle0 = new Bundle();
bundle0.putString(FirebaseAnalytics.Param.VALUE, "usertype1");
mFirebaseAnalytics.logEvent("my_user_type", bundle0);
This value can be usertype1 or usertype2
When im in the Firebase Dashboard i cant find the anwsers anywhere, in fact, the event tab shows this:
tipo_usuario == my_user_type
Valor = value
As u can see, it shows "value 0"
But, when im using the DebugView, i can see the usertype1 or 2 reaching firebase.
What im missing?
Value displays the accumulated value of all "tipo_usario" events but in order for the value to accumulate you cannot use putString(), instead use putLong() or putDouble(). https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Param#VALUE
From what I gather you are looking to differentiate between two different types of users, so you should probably look into user properties instead. https://firebase.google.com/docs/analytics/android/properties
I report a Search event and add the search query to the bundle.
In Firebase, only the event is shown. I can see the stat on the search event log, but I can't see the value of the Term that were searched. From what I understand, the Term param is supported by Firebase.
Here is my code:
Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.SEARCH_TERM, query);
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SEARCH, bundle);
What should I do to get the search term to appear in `Firebase?
You can use custom definitions to solve this problem.
Here's how
Go to firebase console
Then select the custom definition from the left panel
click on "create custom dimension" at the top right
Then enter the details as shown in this photo
After entering detail give it some time and then make a search event from your app.
now go to the events tab -> select search event -> and you will see your search term with the count in a separate card.
More info about the custom dimensions
From what I can understand from your code in the question, the code does not have any errors.
If you are implementing firebase analytics for the first time, it will take 24 hours for the events to appear in the dashboard.
After first event reported, next events takes around 3-4 hours to update in google dashboard.
Hope this info helps :)