Hey There! :wave: Your message has been received ...
# support
s
Hey There! šŸ‘‹ Your message has been received by the RudderStack team. Our standard customer support hours are 9-6 PM EST, but we will forward this request to your Technical Account Manager, and they will get back to you shortly. Please use the thread for any additional comments.
q
Hi @broad-carpet-90114 Let me check this with the team and get back to you.
f
We merge the identities on availability of anonymousId and userId. Basically we merge the anonymousId with userId. Can you share us some payloads that you are sending to rudderstack? And how are you generating anonymousId and userId for a customer??
b
hi @quiet-wolf-72320 @fierce-crayon-64520 thanks for the reply.
Can you share us some payloads that you are sending to rudderstack
when calling the
track
api we mainly send 3 properties/data these are •
data
- contains specific data based on the event (i.e. the color of the button, duration of the video, etc.) •
logged_in
- whether the user is authenticated during the event •
user
- this incudes the plan, role, and number of group members where the user is interacting when calling
identify
we pass the following: • userId (for the first argument) • name, email, avatar (for the second argument) email and userId is always unique per user
And how are you generating anonymousId and userId for a customer??
for the userId, we fetch it from our database when the user logs in, so this is 100% unique per user, we use this library to generate it, on the screenshot above, the one with
us_XXXXXX
(in the distinct id) is how it looks like. as for the anonymousId, we don't really set it and let rudderstack generate it. is it possible that the same anonymous id is generated on multiple users?
are there any thing that I can query in mixpanel to help with the investigation?
f
Can you check once if two users are always merged or more than two users merged as well? You can check from the profile of the user, i.e. how many distinctIds are connected with that.
b
I have a mixpanel/rudderstack user profile where there are 56 distinctIds, 10 of these distinct ids are a user id from our database (I know because it has a
us_
prepend in the value). the rest are random numbers that looks like:
ee2d199f-51d1-4622-9a84-18cac2886e45
I'm not sure where did this came from but I'm guessing that this is an anonymous id? 🤷
the users in the profile are from spain, germany, philippines, US, denmark, etc.
f
Yes, we generate this type of anonymousId.
Are you making any identify call for anonymous users?
b
no, we only call the
identify
method on a successful login/signup (or on page reload after fetching the current user API). šŸ¤”
and this is how we call it:
Copy code
window.rudderanalytics.identify(
      user.id,
      {
        name: user.display_name,
        email: user.email,
        avatar: user.avatar,
      }
    );
f
It looks like userId is getting duplicated for some user. And that is why some users are getting merged.
As you make the identify call it will have both the anonymousId(generated by rudderstack JS SDK) and userId(provided by you guys). So in the merge call userId and anonymousId will get merged. Now our anonymousId will be persist in the client's browser cookie. There might be a possibility that the userId is getting duplicated.
b
hmmmm it should be impossible on our flow right now šŸ¤” are there any other way for the merge to take place? and if the user id is duplicated for some user, how did we have their original user id in the distinct id?
f
or on page reload after fetching the current user API
In the page load call if the userId is different with the userId by which the user was created then this scenario can happen. Let's say you have make the identify call with
anonymousId1
and
userId1
. Later in page load call you have updated the userId with
userId2
. As the previous anonymousId will persist in the cookie, the new identify call will happen with
anonymousId1
and
userId2
. And in this way both of the userId will get merged.
b
I see, but this would only happen if those users are on the same machine right?
f
Yes
b
I had come on the same conclusion when I first noticed this but I don't think this is the case as those user are in different countries (one of them is my co-worker and he only used a single account on his machine). not really sure what's going on, on the reason that you said, do you think that it would resolve the issue if I generate a new anon id everytime I call identify?
f
Yes that would solve the problem but the anonymousId should be unique. But that is not how we should use the anonymousId. If you proceed with this approach one user will be assigned with lot of anonymousIds, which is not expected as well.
Can you confirm if the userId is unique for a user always?
Can you share the destiantionId?
b
destination id:
2Avos6c5MSH8WCsTna5sck2zcJl
if you have access, this is one of the distinct id of the user profile with multiple accounts:
us_01G9DXBGQ6HFXKV9XPDEDVEK2W
Can you confirm if the userId is unique for a user always?
yes it is always unique as it we will have a conflict in the database if it is not.
f
Okay
šŸ™‡ 1
I tried to replicate this issue by creating account in videocom.com. But every thing looks fine there. We are creating one anonymousId and that is persisting there. When tried to login using the email in another browser then also get the same userId. Now one possible reason would be if you don't delete the anonymousId for one user and another user login from that browser then the new user will get assigned with the old anonymousId. But that is not the reason here as the users are from different locations. So from our end it seems correct. For further investigation on this issue you can share us how you have instrumented all of the 5 sources? When those sources are triggering events? And you can dump all your source data in some place and run some analysis on them to check if you are having any collision for anonymousId or not.
b
I see, yes it doesn't happen on every users but only on few users. As you've suggested, I will conduct a deeper analysis for this one on our end as it is really quite tricky. Thanks for your time! will let you know if I found something.
šŸ™Œ 1