Solved

Backend device id merged with users

  • 22 October 2021
  • 5 replies
  • 511 views

Badge

I started sending events from the backend with a specific device id and no user id.

What I can observe now is that the backend device id gets merged with random users.

How can I fix that?

icon

Best answer by Denis Holmes 25 October 2021, 08:33

View original

5 replies

Userlevel 6
Badge +8

Hi @florian-milky ,

 

If you are sending a Device ID from the back end and there already exists a user with that Device ID, it will merge, expecting it to be the same user. You would need to make sure that no Device IDs you sent from the back end are also in the front-end unless you want them to merge. A suggestion I would have is to make sure the Device IDs from the server are unique in the sense that you might attach a prefix or suffix such as SER to identify the events coming from the user base. I hope that helps!

 

Kind Regards,
Denis

Badge

Hi @Denis Holmes ,

Thank you for your answer.

We have a specific Device ID for our backend that we never used in the frontend. So I don’t think the problem comes from there.

Another things we do is that we sometimes send events from the backend that we associate with the user (through User ID).

So we set up both User ID and Device ID (our backend) for these events. So in the user timeline we can see for example that we sent an email to them.

Is that possible in that case that our backend becomes merged into user timelines even for unrelated events? How should that be handled then?

Userlevel 6
Badge +8

Hi @florian-milky ,

 

The user should only merge if a user in Amplitude has the same User ID event sent to Amplitude and a user already exists or if an anonymous user sends the same Device ID for a user that already exists. So if the Device ID from the back-end also exists in the front-end, users will be merged. I would suggest to make sure that the Device ID is truly unique so that it will not merge users. Does that make sense?

 

Kind Regards,
Denis

Badge

@Denis Holmes I think so!

For a while, we did it incorrectly and we attempted to set User ID for anonymous users (from the backend), so that could be why we’ve seen our backend device merged.

I’ll keep an eye out and maybe even rename our backend Device ID.

Thank you

Userlevel 6
Badge +8

Hi @florian-milky ,

 

Any issues with it and you can contact us again here in a comment, through another post or you can PM me!

Reply