Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrieve user property from Firebase Analytics

I am currently setting Firebase Analytics properties like gender and usernames as follows:

firebaseAnalytics.setUserProperty("username", /*someusername*/);

After successfully setting them I want to be able to receive them at some other point inside my application. Somehow similar to the Firebase Database.

Is this possible? I have not found any explanation in the Firebase documentation.

like image 734
Doge Avatar asked Jan 15 '17 17:01

Doge


People also ask

How do I see user properties in Firebase Analytics?

You can access this data from the Custom Definitions page of Analytics in the Firebase console. The page shows a list of user properties that you have defined for your app.

How do I see user properties in Google Analytics?

To find some user properties that you want to create, go to the data layer screen in your Tag Manager account to see what values you are tracking and find the ones you want to recreate in GA4.

How can I get user details of Firebase authentication?

If the user login with a custom "email/password" you don't know anything else about that user (apart from the unique user id). If a user login with Facebook, or with Google sign in, you can get other information like the profile picture url. It is explained here: firebase.google.com/docs/auth/android/… .


1 Answers

Currently, it is not possible to retrieve Firebase Analytics User Property.

The best way you can do is to also store those properties to Firebase Database for each user. The database structure should look something like this

{
    "users": {
        "<uid>": {
            "username": "someusername",
            "gender": "M",
            "birthDate": 758634444000
        }
    }
}

The uid is retrieved from FirebaseUser.getUid()

Hope this helps :)

like image 171
Wilik Avatar answered Oct 14 '22 06:10

Wilik