firebase-android-sdk
firebase-android-sdk copied to clipboard
Firebase Analytics: Setting userID to null does not clear the userID
[REQUIRED] Step 2: Describe your environment
- Android Studio version: Bumblebee 2021.1.1 Patch 2
- Firebase Component: firebase-analytics-ktx
- Component version: firebase-bom:29.0.3
[REQUIRED] Step 3: Describe the problem
It is stated in the docs that setting the userID to null should remove the userID. But, it does not remove the user ID when it is set to null.
Steps to reproduce:
- Enable firebase analytics debug view
- Set user id with that method: firebaseAnalytics.setUserId(userId)
- In Firebase debug view, verify that the user ID is reported.
- Set userID to null: firebaseAnalytics.setUserId(null)
- Expected: UserID is should be cleared from user properties.
- Result: UserID remains the same as the previous value. Setting it to null does not clear it.
That's a big privacy issue. As a workaround, when user chooses to opt out from identified analytics, we set the userID to String "null". So, userID gets updated to String "null".
Some other related threads:
- https://github.com/invertase/react-native-firebase/issues/1247
- https://github.com/invertase/react-native-firebase/issues/4931
- https://stackoverflow.com/questions/53077408/android-firebase-analytics-not-able-to-set-null-to-userid-and-userproperty
I found a few problems with this issue:
- I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
- This issue does not seem to follow the issue template. Make sure you provide all the required information.
Hi @zmeid, thanks for reporting. I was able to reproduce the same issue. That being said, I'll notify an engineer about this.
Hi @zmeid, upon investigating, it looks like the issue isn't the setUserId not working. The user id is indeed removed, but the debugView isn't showing this, so this is a UI issue. There's a similar issue in firebase/firebase-ios-sdk#4856
Hi @argzdev. Thanks for quick investigation!
Should we continue to watch that issue on firebase/firebase-ios-sdk#4856?
Hi @zmeid, this is currently being tracked in b/149401786. Yes, please do continue to monitor that issue as well. I'll add replies back here once we get updates. Thanks!
This came up again (third time now...) in https://github.com/invertase/react-native-firebase/issues/6583 Is there any ETA on a fix for internal issue b/149401786 @argzdev ? Thanks!
Hi @mikehardy, I checked the internal bug and unfortunately there hasn't been any progress. Let me bump up the internal bug to get some updates.
I just implemented a new (actually working!) stale bot on react-native-firebase and it showed me this had gone stale over there, so I'm carrying the same "is this stale? is there something to do?" message over to here. Any news ? Thanks!
Hi all. Sorry for the silence here. Our engineers are still looking into how to fix the issue. Though rest assured, this is only a UI issue in DebugView, and the user ID is indeed removed once it is set to null. Also something we noticed during experimentation is that while the DebugView UI issue still shows up, this does clear up after approx. 1 hour.
Anything new on this topic? We are running into the same issue
Similar issue for GA4 analytics
Still the issue
Any updates on this? This makes every app using the firebase/analytics in breach of the EU GDPR & ePR laws. As clearing the userID still records in GA4/Firebase
I facing this issue too, any update here?
@mvn-vinhhuynh-dn Seems like this would need some work from the community to get it up and running. We've done a work around for now. Wiping the userId, then creating a new session when wiped. This removes the userId completely from. Not ideal, but works.
@instesti
Wiping the userId
this mean we set null
value to userID then send firebase? Like this:
fa?.setUserId(null)
@instesti
Wiping the userId
this mean we set
null
value to userID then send firebase? Like this:fa?.setUserId(null)
Yes, in theory, however we ended up using:
analytics().resetAnalyticsData();
then starting a new session.
aw, thanks for answering @instesti
@instesti
Wiping the userId
this mean we set
null
value to userID then send firebase? Like this:fa?.setUserId(null)
Yes, in theory, however we ended up using:
analytics().resetAnalyticsData();
then starting a new session.
@instesti what exactly are you using to start a new session after resetting?