Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Analytics Filter By User ID

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...

like image 668
Kostyantin2216 Avatar asked Feb 09 '17 12:02

Kostyantin2216


2 Answers

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.

like image 89
Kostyantin2216 Avatar answered Sep 19 '22 10:09

Kostyantin2216


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. New user property

And... that worked...Now I can filter new events based on user id. enter image description here

like image 45
HBB20 Avatar answered Sep 20 '22 10:09

HBB20