Closed luislhl closed 3 years ago
Hi Sorry for getting delayed on this. Yes, reset() doesn't delete the current anonymousId. This is kept to be synonymous to the deviceId as the SDK doesn't store a deviceId separately. Thinking more, we can overload the reset api with a reset(true) to delete the anonymousId too. One doubt I have is: to the example calls provided, is this something that will happen on the site/prod env. You may want to track the user using the same device for different login emails right?
The next point on identify not getting merged always, can you explain the behaviour you are seeing. It will help to dig into it more.
I posted in slack about this issue and was pointed here. We use Mixpanel integration too and the above behavior was causing multiple users on the same device to merge.
To fix (for us), we're calling the below which behaves how I'd expect. reset() getAnonymousId()
For our case, if a user logs out of the site or otherwise indicates they are 'done', we would always want the anonymousId reset. Even if they plan to login again with a different email, I'd want that tracked separately. It could be a shared computer, a husband and wife, parent/child or many other circumstances of unique users. If there's a reason we determine to merge their accounts based on other behavior, we can choose to do that. With reset() as it is, merges happen unexpectedly.
On a device, I can understand the behavior of just a DeviceID and no anonymousId. Devices are more personal. Computers are more often shared. At the very least, the reset() documentation (especially in MixPanel) should be made much more clear.
we have overloaded the reset call with reset(flag). Calling reset(true) will also clear the stored anonymousId. Please let us know if this helped.
This feature has been merged. Hence, closing the issue.
This feature has been merged. Hence, closing the issue.
This should definitely be documented in:
@gbinow Thanks for the suggestion. We'll update our docs.
I'm having this issue where I expected that the reset method to reset the anonymousId, but this is not the case.
Not sure if this is the expected behavior or not.
What i'm doing can be simplified as follows:
But then all 4 requests are sent with the same anonymousId, which causes a merge event in Mixpanel, which is one of my destinations.
This is one of the requests:
This is Mixpanel merging the users:
Another thing I'm also struggling to understand is that not every identify calls get merged all time, seems a little random to me.