Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
zmeid opened this issue Mar 30, 2022 · 23 comments
Open

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

zmeid opened this issue Mar 30, 2022 · 23 comments

Comments

@zmeid
Copy link

zmeid commented Mar 30, 2022

[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:

@google-oss-bot
Copy link
Contributor

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.

@argzdev
Copy link
Contributor

argzdev commented Apr 1, 2022

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

@argzdev argzdev added the type: bug Something isn't working label Apr 1, 2022
@argzdev
Copy link
Contributor

argzdev commented Apr 1, 2022

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

@zmeid
Copy link
Author

zmeid commented Apr 4, 2022

Hi @argzdev. Thanks for quick investigation!

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

@argzdev
Copy link
Contributor

argzdev commented Apr 4, 2022

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!

@mikehardy
Copy link

This came up again (third time now...) in invertase/react-native-firebase#6583
Is there any ETA on a fix for internal issue b/149401786 @argzdev ? Thanks!

@argzdev
Copy link
Contributor

argzdev commented Sep 30, 2022

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.

@mikehardy
Copy link

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!

@argzdev
Copy link
Contributor

argzdev commented Dec 22, 2022

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.

@PhilippNowak96
Copy link

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

@boltcoder
Copy link

Similar issue for GA4 analytics

@Velord
Copy link

Velord commented Feb 5, 2024

Still the issue

@instesti
Copy link

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

@mvn-vinhhuynh-dn
Copy link

I facing this issue too, any update here?

@instesti
Copy link

instesti commented Apr 3, 2024

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

@mvn-vinhhuynh-dn
Copy link

mvn-vinhhuynh-dn commented Apr 3, 2024

@instesti

Wiping the userId

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

fa?.setUserId(null)

@instesti
Copy link

instesti commented Apr 3, 2024

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

@mvn-vinhhuynh-dn
Copy link

aw, thanks for answering @instesti

@dgreasi
Copy link

dgreasi commented May 14, 2024

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

@intraector
Copy link

Still not fixed

@instesti
Copy link

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

In order to restart the session you can do:

analytics().setAnalyticsCollectionEnabled(true);
analytics().setUserId(userId) // this can be skipped if you want to restart the session without userId, given it's already wiped

@instesti
Copy link

@mikehardy Do you have any ideas if this will ever be addressed by G? (I can reach out to my contact to try to get some info, unless you aware of something). As mentioned in the earlier comments, we've done a workaround which is not pretty, but makes sense that the underlying issue is fixed from G's side.

@mikehardy
Copy link

@instesti I have no insight, sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests