segment-boneyard / integration-amplitude

Amplitude server-side integration
segment.com
MIT License
4 stars 7 forks source link

Why use deviceId instead of anonymousId? #18

Closed tonyxiao closed 8 years ago

tonyxiao commented 8 years ago

https://github.com/segment-integrations/integration-amplitude/blob/master/lib/mapper.js#L75-L84

f2prateek commented 8 years ago

Do you mean this line specifically https://github.com/segment-integrations/integration-amplitude/blob/master/lib/mapper.js#L83? We send it as device_id https://github.com/segment-integrations/integration-amplitude/blob/master/lib/mapper.js#L98 which is different from anonymousId. The same anonymousId can have multiple device ids.

tonyxiao commented 8 years ago

Isn't that actually a reason for using anonymousId rather than deviceId? Since ultimately deviceId is used to identify anonymous users. In the case of one anonymous user with multiple device id sending that single anonymous id would actually allow amplitude to not create duplicate users.

f2prateek commented 8 years ago

since ultimately device ID is used to identify anonymous users.

Correct, and that's an amplitude quirk. We could send anonymous id but if you're using the raw data in Amplitude then your anonymous id will be called device ID in amplitude.

Additionally sending the device ID as we do now is more consistent with what Amplitude does in their SDKs (e.g. sends idfv on iOS).

So the tradeoffs or are either be more semantically consistent and map our device ID to Amplitude's device ID but maybe not consistent for analysis on anonymous users; or send anonymous id as the device ID which is more consistent for analysis but not so much with the naming.

tonyxiao commented 8 years ago

Yea seems that both would probably work in practice and certainly not worth changing from one to another. Thanks for the explanation. Closing