I'm not sure I can think of a good solution. Can you describe the problem in a little more detail?
You could store the device ID on the "extra" property of users and use that to link accounts later, but the API isn't really set up to send location data to more than one user account.
I suggest that better way in saving array with information about users in "extra" field instead of creating new anonymous users every time when its need.
for example: "extra": ["user1info", "user2info", "user3info"]
instead of "extra": "user1info", then creating new user with "extra": "user2info" when it need, and then creating new user with "extra": "user3info" when it need.