Closed mattiaslevin closed 9 years ago
Hi @mattiaslevin
How does uid related to cid and _id?
to keep things simple here is proposal:
setUserId
and getUserId
e1f7d8e178b7a866
unique to the given session.setVisitorId
and getVisitorId
and then you don't need to pass the &cid= parameter -> users can use the setUserId feature instead.Does it help?
Thanks, just a few more questions:
-Is the _id a unique identifier for the user or for the current session (should I generate the _id just one time for the same user or change each session)? -I am guessing the SDK should always generate the _id behind the scenes and pass to the Piwik server. The user can optionally set a uid? -This would mean that if the same user is running on two different devices (e.g. iOS and Android) each device will have its own randomly generated _id but can set the same uid. Piwik will then be able to combine the events for the same uid? -Just for curiosity, what is cid? (and alternative to uid)?
-Is the _id a unique identifier for the user or for the current session (should I generate the _id just one time for the same user or change each session)?
_id is an identifier for the current user. (it maps to Visitor Id
)
-I am guessing the SDK should always generate the _id behind the scenes and pass to the Piwik server. The user can optionally set a uid?
Sounds good!
-This would mean that if the same user is running on two different devices (e.g. iOS and Android) each device will have its own randomly generated _id but can set the same uid. Piwik will then be able to combine the events for the same uid?
As soon as &uid=
is set then Piwik will simply ignore the _id=
parameter even when it is set. uid
always takes precedence over &_id
and &cid
-Just for curiosity, what is cid? (and alternative to uid)?
cid
was in some way the feature we exposed because we hadnt yet implemented User ID. now that user id exists it's better to use this instead of cid. cid
still works but it's less convenient to use since you must pass a 16 chars hex string which is less convenient than setting any arbitrary user id.
Fixed in 3.0.0
Add support for the new userID feature added in Piwik 2.7.0 http://piwik.org/docs/user-id/
How does uid related to cid and _id?