Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reset user_id value in Firebase Analytics

Actual event logs taking a few hours to reflects on the dashboard. So I am using DebugView to analyse events.

My app has a login/logout feature. App can be used by multiple users.

On successful login, calling FirebaseAnalytics.getInstance(context).setUserId("user id").

Then after all the further logs goes under given user ID. Till now its good. But If I login with different user then user id doesn't get change and all logs events goes under previous one.

How to reset User Id on each login call?

like image 866
Rohan Patel Avatar asked Sep 12 '17 10:09

Rohan Patel


1 Answers

You can remove the User ID by setting it to null or replace it with a new user ID. userID is just a user property that goes with all events after it is set so you need to set it to null when user logs out and set a new user ID when a different user logs in.

like image 131
adbitx Avatar answered Nov 10 '22 00:11

adbitx