Use email as id for users and fix signup events not being reported (#1067)
This commit is contained in:
parent
fcb6c4c43c
commit
fa709a6cde
|
|
@ -65,13 +65,13 @@ public class AnalyticsService {
|
||||||
return userMono
|
return userMono
|
||||||
.map(user -> {
|
.map(user -> {
|
||||||
|
|
||||||
// In case the user is anonymous, return as is without raising the event.
|
// In case the user is anonymous, don't raise an event, unless it's a signup event.
|
||||||
if (user.isAnonymous()) {
|
if (user.isAnonymous() && !(object instanceof User && event == AnalyticsEvents.CREATE)) {
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
HashMap<String, String> analyticsProperties = new HashMap<>();
|
HashMap<String, String> analyticsProperties = new HashMap<>();
|
||||||
analyticsProperties.put("id", object.getId());
|
analyticsProperties.put("id", object instanceof User ? ((User) object).getUsername() : object.getId());
|
||||||
analyticsProperties.put("object", object.toString());
|
analyticsProperties.put("object", object.toString());
|
||||||
|
|
||||||
analytics.enqueue(
|
analytics.enqueue(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user