firebase / firebase/firebase-android-sdk

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

Open
#3,602 29 comments 12 reactions 0 assignees View on GitHub
api: analytics tracking-internally type: bug
Dominant language
Java
Stars
2.6k
Forks
710
Avg merge
2d 9h
Merged PRs (30d)
31

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.