I had integrated Firebase analytics in Android few months back.
Initially I was setting the user_id wrongly, by using the following code :
mFirebaseAnalytics.setUserProperty("userId", "<value_of_type_1_for_user_id>");
As a result my user_id column in bigquery was null. Hence on my next release, I corrected it and used the following method :
mFirebaseAnalytics.setUserId("<value_of_type_2_for_user_id>");
This created a problem as all those users who had installed/used the app between those two release dates have an extra user property key named "userId". And this has some wrong values of user_id.
Now, another strange thing that has happened is that there are many new users who are onboarding the platform now with the latest version of APK. A small percent of these users still have the malicious key of "userId" under user_properties.
I need help in understanding the following :
- Understanding the reason behind why new users (a random small group of them) are still being affected by this wrong mapping ?
- How to clean up the user property field of old users by removing this property key for all users.
You can set the user property "userId" to null/empty and the user property will be removed from the future events. User property will stick with events until you explicitly remove it.
Related
I am new to coding and I am just playing around to build an app where everyone can post new events. So I have already created notes like "user" and "events". The problem I face off is that I dont know how to avoid duplication like for example if two users are posting the excat same event.
I don't want to show them twice in my RecyclerView.
So I have to compare the date, the location and the description, due to this many queries, is the Firebase Realtimedatabase the right "tool"? Or should I use another software.
------/Events
---------/LbwXYVICCl9xd5m..
--------------datum: 10.04.2019
--------------userid: OncDIQis...
--------------location:New York
--------------description:Coldplay
You seem to define two events as being the same based on some of their properties having the same value. In a scenario like that, I'd use those combined properties as the key of the event.
So if you say that two events are the same if they have the same date, location, and description, then you can create the unique key of that event as ${date}_${location}_${description}. For example:
20190410_New York_Coldplay
I've put the date in an easier to search for format, which also filters the .s (since those are not allowed in keys. Now you can store the event under that key:
Events
20190410_New York_Coldplay
datum: 10.04.2019
userid: OncDIQis...
location:New York
description:Coldplay
With the above structure, if another user tries to create an equivalent event, it will get the same key.
Firebase Real-time database is the right tool for you as it updates the database in real time.
At the time of fetching the data from the firebase, you can check whether it is already present in your local database(where you are collecting data fetched from the firebase) or not.
I hope this will help you out.
I want a support on Firebase Analytics Dashboard. I register events with screen name of my iOS and Android app and these values are informations showing correctly on Firebase Dashboard. But an extra parameter is also showing in using "(not set)" with frequently updated values.
Can anyone tell me the actual reason why this is showing?
After some analysis in our project, it seems like it is because we are trying to log anything other than strings or numbers (in our case boolean).
Based on this view it seems like Firebase only allows Strings or Numbers:
(Adding a new parameter to an event)
It seems, though, as "Numbers" means more than just int, based on this screenshot with double and long:
(Suggestion from Firebase to events to add, and example code)
This is how we do it in the (Android) code:
Android Studio does not complain since its using a regular Bundle which allows to set booleans and other kinds of types.
And this is how it looks in Firebase Analytics:
A simple fix will be to just do:
bundle.putString(YOUR_KEY, String.valueOf(yourBoolean));
A better fix will probably be to make better or more useful tracking events, using strings or numbers.
The Firebase Android SDK for analytics provides a method named setUserId(String id), now i enabled firebase logging and every time i called the method setUserId(1234) i see this in the logs Setting user property (FE): _id, 1234.
My question is how come the Firebase dashboard does not let us filter by this property, there is no property not for userId and not _id, i even tried to add _id as a property in the dashboard but Firebase does not allow property names to start with an underscore.
Do i really have to stop calling that method and just do setUserProperty("userId", 1234) or am i missing something...
I have spent a few hours on this and found the answer i was looking for more or less, hopefully this might save someone else some time.
The only way to filter by Firebase's User Id property is by creating an audience, there you will be able to pick the user id property that is supplied from the setUserId(String id) method.
It is a downer though because you won't see any events for the user/user's you want from before the audience was created.
I was scratching my head with this issue. Initially, I felt so dumb when I could not find how to use user id for filtering in Firebase analytics dashboard that I am setting with official API setUserId(). When I try to look for answer, I realized that I am not the only one. Finally, this is how I was able to filter events based on user id.
In Android Code, I set user id using setUserId() method. When I read bigQuery has this property as user_id, I thought to give it a try by adding a new user property in Firebase Dashboard with the hope that it will fetch the reported id.
And... that worked...Now I can filter new events based on user id.
In audience you have to select contains, exactly match or regular expression for a field.
So to filter for a user you have to add all your users to the audience, which looks cumbersome.
Isn't using setUserProperty is better? Have you faced any problems with using it ?
I am using Firebase Remote Config feature to fetch some parameters required by the application. The parameter values depends on the userProperty which I have defined in the user properties tab in the Analytics section in Firebase.
Now, I want to get the parameter value for which the particular user property is true. I have defined condition using that user property. For example, lets say that the user property screen_size is what I have a defined condition for, such as if screen_size matches AxB then set a parameter named mqtt_chat_enabled to true and the default value is false.
When I fetch the remote config, I am getting the default value of mqtt_chat_enabled even if the screen_size is AxB.
The question is, how do we send the condition parameters when fetching the remoteConfig?
I tried using setUserProperties method before fetching remoteConfig, but it's not working.
I am not getting anything for this on the web. Please help.
I was also facing the same problem. It turns out be issue with the firebase version. Upgrade your google play services and latest version of firebase, it should work then.
I am using firebase version 10.2.0
I have been using Firebase Analytics for quite some time now and I wanted to know if we could add or modify some specific keys (other than userId) in the analytics data visible on BigQuery? The reason I'm asking this is so I can map my old users to the new users on Firebase.
Looking at the analytics data on BigQuery, inside device_info there is a key device_id whose value I always found null. I want to modify this value as I was previously setting it for my old users. This would help migrate users from my old analytics db to Firebase. Not only the device_info, can I modify/add new key-value params in the other dimensions too?
All help is appreciated.
device_id in device_info is only populated on iOS platform with the IDFV, if IDFA is not available. It is not used for the Android platform.
https://support.google.com/firebase/answer/7029846?hl=en
There is no support for overriding these values that I'm aware of.
Meanwhile, if you have access to, say, the resettable_device_id, you might be able to use that to join in other data you have for the old users in BigQuery.