Reputation: 311
I am integrating Firebase-Analytics for my unity project. During Firebase initialisation I have to call this method as shown in the official quickstart example project.
// Set the user ID.
FirebaseAnalytics.SetUserId("uber_user_510");
How can I get this user ID for both Android & iOS platform in my Unity project?
From the official documentation:
public void setUserId (String id)
Sets the user ID property.
Parameters: The user ID to ascribe to the user of this app on this device, which must be non-empty and no more than 36 characters long. Setting the ID to null removes the user ID.
Upvotes: 0
Views: 2399
Reputation: 17523
You don't have to call setUserID
. Firebase Analytics will work just fine without it. And it's value can be whatever you want.
The setUserId
call is really there for developers who are, say, analyzing their Firebase Analytics data in BigQuery and want to merge session data in cases where the same user is playing their game on multiple devices. And so they might make this call using some internal userID that they've created on their side. (Although our lawyers would like me to remind you that this userID should be created in accordance with Google's privacy policy)
If that's something you're not interested in doing, or want to put off until later, it's perfectly fine to simply leave off this call.
Upvotes: 1