Closed oscargrgm closed 6 years ago
Why are you trying to do that?
The documentation states:
User ID is any non-empty unique string identifying the user (such as an email address or an username).
You can either remove it, or set it to something, "nothing" is not supported: https://github.com/matomo-org/piwik-sdk-android/blob/v2.0.0/piwik-sdk/src/main/java/org/piwik/sdk/TrackMe.java#L43
The reason is we have defined a non-logged users system which have an empty USER_ID
. I guess we should define another system and set a standard USER_ID
for those non-logged users.
You can close the issue then. Thank you very much!
Providing an empty user-id for all non-logged-in users, even it is accepted by the server, would aggregate all visits with empty "user id" as visits from the same user. So then in tracking you get many different logged-in users, but one huge "not-logged-in". I think this would make the statistics quite unusuable.
Being logged in or not should not change the user-id as it's still the same individual that might just have logged-in while using your app. It's more of a status, an attribute per user. I think I would do this via custom dimensions.
If you search for this, I'm sure this has come up before somewhere as this is not specific to apps and seems like something a lot of piwik/matomo users have thought about.
I'm using the version
2.0.0
of the Piwik SDK and trying to set theUSER_ID
of myTracker
as an emptyString
but it sets up automatically a random one.This is my declaration:
I've also tried to set it as empty inside the
if
condition but is not working either. Is there any way to do it?