Open cerupcat opened 3 years ago
Doing some more research, it's unclear if this is an Amplitude bug or Segment bug.
When calling identify
in the Segment SDK, the Amplitude SDK method is called - (void)identify:(AMPIdentify *)identify
. However, the identify.userPropertyOperations
are the traits that were first set in the first identify call, not the most recent traits in the identify
call and therefore previous traits are set on new users when identify
is called.
On -(void)reset
, reinitializing the identify in SEGAmpltidueIntegration.m
seems to solve this.
- (void)reset
{
[self.amplitude setUserId:nil];
SEGLog(@"[Amplitude setUserId:nil");
[self.amplitude regenerateDeviceId];
SEGLog(@"[Amplitude regnerateDeviceId];");
self.identify = [AMPIdentify identify]; // NEW CODE
SEGLog(@"[Amplitude reset identify];");
}
Pull request: #95
Users that logout and create another account are associated to the original user.
I'm currently performing the following:
Identify
when a user logs in and set atrait
foremail
.Reset
when the user logs outIdentify
when new user logs in (or creates account) and settrait
foremail
.The second user is associated with the first in amplitude and the
email
trait is not set.