balena-io-modules / analytics-client

Client part of analytics services used at balena
5 stars 0 forks source link

Handle the case when user ID and device ID are equal #28

Closed roman-mazur closed 4 years ago

roman-mazur commented 4 years ago

Because we migrate from mixpanel to amplitude and use the old distinct_id as a device ID, we can have situations when user ID and device ID are set to the same value in Amplitude client.

However, the Amplitude service seems to ignore the user_id in such case. This leads to some problems with reporting (if the same browser is used for multiple users, we get events reported for a wrong user).

This change ensures we don't set device ID to a user ID value when we have a choice (when multiple profiles are merged).

Change-type: patch Signed-off-by: Roman Mazur roman@balena.io