There is a blog post about this option: https://www.mendix.com/blog/using-the-after-sign-in-microflow/
Regards,
Ronald
You could associate an object to the user. When an anonymous use logs in, there's an option to run a microflow where you have both "user" objects (anonymous and registered) available to you and you can transfer any information you need between the two users. That microflow option is available in:
Project Security -> Anonymous users -> Sign-in microflow
This feature is most commonly used for transferring a user's "shopping cart" or similar objects, but I'm sure you could use it to track your user's location as well.
There may be another way to handle this even more efficiently through the use of the new Mendix page URL feature, but I haven't tried anything myself just yet.