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.
Related
I am new to Firebase Analytics and I went through some online tutorials to learn about it. I have a simple 'Notes' app (Android) in market, which allow users to create and save notes offline on their device.
It would be great, if I could get a total number of notes that have been created till date with my app. I know, I can add an event which will notify Firebase when user creates a new note, but what about the existing notes that are present in the database?
Is there any way to get such statistics through Firebase Analytics?
UPDATE:
I have included a user property as notes_count, but I am not able to find a way to see the total. How to do it?
You could set a user property with the number of notes the user has created instead of or in addition to logging the event. You are limited to 25 different user properties total though, so use them with care.
I have an Android app that uses the Firebase Realtime Database. At the moment it is a single user app, in that when a user logs in, using Firebase Auth, the data they create is kept private to them. What I need to do for the next phase of the project is to allow for the creation of teams or user-groups that have access (read and write) to the data currently created by a single user.
The database structure and rules for doing this are understood, however, the issue I have is how to create the groups.
I did find the following blog and it is very close to what I need, it does not make clear how a new user would create the pending membership entry in a specific "chat" (this is a group chat sample).
https://firebase.googleblog.com/2016/10/group-security-in-firebase-database.html
Any points on resolving this final issue would be much appreciated.
Sid
Just simply create groups like below
|--Groups
|---group1
|-----uID1 - owner
|-----uID2 - participant
|-----uID3 - participant
..............
follow this https://firebase.googleblog.com/2016/10/group-security-in-firebase-database.html link. There are example groups and rules. It will help for u to proceeds it.
Follow this https://firebase.google.com/docs/database/ios/structure-data to make good structure of data to increase performance
Recently I've been working on a News App where I store information of news artciles in Firebase database. Following is an image of the structure of my Firebase database.
I read somewhere that it is not advisable to keep numbers as keys for Firebase database. However, I've not been able to figure out any explanation for this. Is there any norm that Firebase keys should not be numbers ?
If so, can I have key names as National_01, National_02, National_03... and so on for each news category?
TL;DR It is okay to use keys like "National_01" for static data and mini projects; Use Push Keys for dynamic data and big projects.
Here are some benefits of using Firebase Push Keys
Push Keys are automatically generated
If you continue to use manually created keys whenever you will have to update the data you have to do create a key like this:
String category = "National;"
count = count + 1;
String key = category + count.toString();
// Not say keep track of the "count" too
Instead, if you decide to use Firebase Auto-Generated Push Keys:
String key = mDatabase.child(category).push().getKey();
Nearly Impossible to Duplicate Push Keys
If you use self-generated keys there might me an error in creating keys hence creating a duplicate key. In that case, you might loose data since you overwrite data under the original key you duplicated.
Whereas, push ids are nearly impossible to duplicate and take no extra code to implement.
The Conclusion
So continue to use self-generated keys only and only if your data is static (which I don't think it should be coz it's a news app) and you don't wish to scale this static data (which again is unrealistic to imagine for a news app).
But remember it is PROGAMATICALLY EASY to work with Push Keys and is FUTURE PROOF in case you intend to Scale your app in future. :)
Edit
Moreover, the Push Keys generated are generated based on timestamp hence all the keys will be sorted chronologically by default!!
Using key names in your Firebase database is not a bad practice but according to your app complexity you can choose whenever to use those keys or the random generated keys.
Using the keys generated by the push() method, guarantees you the uniqueness, because the algorithm is based on a timestamp. Because of this, all your items will automatically be ordered chronologically.
If you want the users to post news in your app, because Firebase generates a unique key for each new news, no write conflicts will occur if multiple users add a post at the same time. This cannot be achieved with your key names in a very simple way.
Hope it helps.
For the record: I've read in the Firebase Best Practices documentation, that you shouldn't use custom keys for large projects, because that will disable the sharding method used in the background.
You can check further details at:
https://firebase.google.com/docs/firestore/best-practices
I am new in Firebase and I am trying to understand it, I want to track whitch achievements( by my id) my users unlocks
I saw lot of post about this like this where it says
Currently, parameter reporting is offered only on a subset of suggested events. If you need to access your custom parameters, you can link your app to BigQuery and run queries on the raw data there.
So as far as I understand, It should show the values of the suggested events,but I dont even get that values, I am getting the events but not the values, My console shows no values.
I am doing something bad on the code? I am misunderstanding events? Or is Firebase not working as it should?
Code sending to firebase my id
Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.ACHIEVEMENT_ID, Integer.toString(lm.logros[a].id));
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.UNLOCK_ACHIEVEMENT, bundle);
For accessing all the data(in your case the values part) that you log in Firebase Analytics.. you have to link firebase to use Google Big Query service that's not available for Free.
I'm planning to use Firebase Analytics for my Apps. According to Firebase Docs is possible to set custom user properties docs here Android and IOS. Latter one can use the properties to create audiences in Firebase Analytics Dashboard as described here Analytics DashBoard
I want to use a user custom property as an Array.
For example:
Setting user property to TagsUserLikes=["hashtagBlue","hashtagRed","hashtagGreen"] so latter one I'll be able to track an audience of all the users that follow a particular tag, meaning users that contain the tag in the array.
So latter in the Analytics dashboard a audience defined solely as TagsUserLikes="hastagBlue" will match all users that contain this tag ["hashtagBlue","hashtagRed","hashtagGreen"] and ["hashtagBlue","hashtagDogs"],?
Is this supported in the Google Analytics Dashboard (create audience)?
Is this supported in the Google Big Query?
If Yes How can I achieve this?
tks
Although you could theoretically concatenate a list of tags in one User Property value (and use it for audience creation), the limit on the length of User Property values (36 characters) might make this approach impractical for you.
Alternatively, you can log an event such as "tag_followed" with a parameter "tag_name=" and then you can create an audience of users who log tag_followed with a particular tag_name value.