value parameter not displayed - android

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.

Related

How to view Firebase event parameter values?

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?

Firebase Query - how to order by a separate field?

I'm working with an Android App that functions as an instant messaging service, and I'm at the point of pulling the message data through into a RecyclerView. I have my Firebase Query object returning all the messages that match the id of the chat that has been loaded, this is done like so:
Query qChatMessages = mDbRefMessages
.orderByChild("messageChat")
.equalTo(mChatId);
So far so good, and this is returning the collection of messages that I expect. The problem is now that, upon passing them to the RecyclerView to be displayed, they come out in the inverse order of how you would typically expect an instant messenger to display, so the messages are actually getting older as you scroll down the chat.
My message nodes in the database all have a messageTimestamp field associated with them, so this is what I would want to sort the data by. The problem is that I don't seem to be able to find a way of ordering the data by any field other than the one that I'm querying on, or getting the results back from Firebase and subsequently ordering them.
Does anyone know how I can work around this, or if there's some Firebase capabilities I'm not aware of?
Thanks in advance,
Mark
The easiest way is to store an extra piece of data in your message nodes which is the epoch time multiplied by -1: this way you can sort on this field and the query will return the right order.
See this post on how to get the epoch time: how to get the number of seconds passed since 1970 for a date value?
However, note that with your current data structure, you will encounter a problem: you will need to sort on this new data (e.g. with .orderByChild("messageCreationTime")) AND filter for a given mChatId (e.g. with equalTo(mChatId)), which is not possible.
So, you would have to re-structure your database (if this is possible) like this:
- messages
- mChatId
- messageUniqueID <- most probably auto-generated by Firebase
- messageTitle: ....
- messageCreationTime: -1525857044
And you would query by:
Query qChatMessages = databaseReference.child("messages").child(mChatId)
.orderByChild("messageCreationTime");

Why are my events not showing up in the Firebase Analytics console?

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

Firebase Analytic Search_Term Param value not showing

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

GA Statistics based on values UPDATED in google analitycs

i want to track some values in Google Analytics that are UPDATED not ADDED to the analytics data.
For example, if i want to track what is the average high score among all my users to be able to fine tune the scoring system.
I can add new value of high score every time the game exits, but it will be incremental, the old data from the same user won't be overwritten. So i won't get proper average values.
Is there a way to overwrite the old data in GA?
NOTE:
After filtering based on last update date - this could be used to figure out why your users uninstalled the app and many other things.
Possible workaround to long for a comment no idea if this will work or not:
First I don't know the Android GA side of things but I do have a lot of expense with GA development in general.
When tracking Ecommerce data the only way to remove a transaction is to add a new transaction value of negative the amount you want to remove. This might work in your situation as well, but I wonder if the users will see the negative value when you display them there scores.
Example:
User score : 100 ( the original score)
delete score: -100 ( removing it)
user score: 40 ( re-add the new score)
This will technically mean that there are 3 lines for the user score but when added up by the system they should = the new score.
Again this is how its done in Ecommerce, if this works for you with this I would love to know for future reference I don't think you will be the only one trying to do this.
The concept behind DalmTo's answer is fine, except I would use either event tracking or custom dimensions/metrics. Try the following:
User99 finished their first game with a high score of 125. Send an event with the following structure:
Event Category: User High Score
Event Action: User99
Event Label: (none)
Event Value: 125
When the user plays again and attains a score of 139, send another event with the difference
Event Category: User High Score
Event Action: User99
Event Label: (none)
Event Value: 14
With that data in GA, looking at the events report under the User High Score category will give you a breakdown per user (the Event Action), with the Event Value being the high score for that user.
If you need non-integer values for the high score, then use a custom metric instead.
Depending on your reporting needs, it might be just as easy to define a custom dimension for User ID and a custom metric for High Score and then send a pageview to /game-finished when the game is finished, with those 2 values set accordingly.

Categories

Resources