Firebase Analytics - Associating User With Events

Viewed 1625

I'm trying to understand how to associate Firebase events with specific users across installs/devices. My understanding is that this is accomplished by setting the userId. But Firebase seems to be counting events across devices/installs as coming from separate users despite the same user id being assigned.

Specifically, I have an iOS project that configures Firebase upon launch and assigns a userId:

FirebaseApp.configure()
Analytics.setUserID("user.1")

I then allow the user to log an event by tapping a button:

Analytics.logEvent("test_event", parameters: ["param1": "val1"])

Every time that I delete the app and reinstall, then trigger the event, Firebase is considering it a unique user. The dashboard indicates that test_event was recorded by 4 different users, but the userId was assigned the same value every time the event was recorded.

So my question is- do I misunderstand what setting the userId property does? Am I missing a configuration setting here? What's the deal?

1 Answers

I spoke with Firebase support directly to figure this out. It turns out that the notion of a "user" in the Firebase console is not related to the userID property at all. It always considers new "sessions" (installs, reinstalls, etc) as new users. The userID assigned via setUserID is still recorded with the events, but can only be used to group events under the same user via BigQuery.

Related