admin-analytics: fix to count registered users only once across multiple browsers/IDEs
requested to merge erzhtor/fix-admin-analytics-to-count-registered-users-once-across-multiple-browsers-ides into main
Created by: erzhtor
Currently, "Analytics / {Feature}" > "Unique users"
counts registered users multiple times if they were using on multiple browsers or IDEs. This is true for the "analytics / users" > "Active Users"
metric.
This PR fixes to count registered users only once.
Note:
- that anonymous users will still be counted multiple times since there is no way to distinguish between devices.
- that "forever" deleted (aka nuked) users' devices/browsers/IDEs will still be counted multiple times since we no longer keep their original user ids, thus falling back to anonymous_user_id, which is unique per device/browser/IDE.
Test plan
- check the diff
sg start
- Open http://localhost:3080/site-admin/analytics/search and the rest of the analytics feature pages
- Check that "total/unique" charts load without any errors