firebase-android-sdk icon indicating copy to clipboard operation
firebase-android-sdk copied to clipboard

Firebase Analytics: Setting userID to null does not clear the userID

Open zmeid opened this issue 2 years ago • 19 comments

[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

zmeid avatar Mar 30 '22 14:03 zmeid

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.

google-oss-bot avatar Mar 30 '22 14:03 google-oss-bot

Hi @zmeid, thanks for reporting. I was able to reproduce the same issue. That being said, I'll notify an engineer about this.

argzdev avatar Apr 01 '22 09:04 argzdev

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

argzdev avatar Apr 01 '22 14:04 argzdev

Hi @argzdev. Thanks for quick investigation!

Should we continue to watch that issue on firebase/firebase-ios-sdk#4856?

zmeid avatar Apr 04 '22 17:04 zmeid

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!

argzdev avatar Apr 04 '22 18:04 argzdev

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!

mikehardy avatar Sep 30 '22 14:09 mikehardy

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.

argzdev avatar Sep 30 '22 14:09 argzdev

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!

mikehardy avatar Dec 05 '22 19:12 mikehardy

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.

argzdev avatar Dec 22 '22 10:12 argzdev

Anything new on this topic? We are running into the same issue

PhilippNowak96 avatar Jan 04 '24 14:01 PhilippNowak96

Similar issue for GA4 analytics

boltcoder avatar Jan 22 '24 07:01 boltcoder

Still the issue

Velord avatar Feb 05 '24 12:02 Velord

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

instesti avatar Feb 13 '24 10:02 instesti

I facing this issue too, any update here?

mvn-vinhhuynh-dn avatar Apr 03 '24 07:04 mvn-vinhhuynh-dn

@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 avatar Apr 03 '24 08:04 instesti

@instesti

Wiping the userId

this mean we set null value to userID then send firebase? Like this:

fa?.setUserId(null)

mvn-vinhhuynh-dn avatar Apr 03 '24 08:04 mvn-vinhhuynh-dn

@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 avatar Apr 03 '24 08:04 instesti

aw, thanks for answering @instesti

mvn-vinhhuynh-dn avatar Apr 03 '24 08:04 mvn-vinhhuynh-dn

@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?

dgreasi avatar May 14 '24 07:05 dgreasi