DEV Community

Discussion on: Tracking guest users

Collapse
 
recursivefaults profile image
Ryan Latta

Think about it like this.

There are "sessions" where people use tiktok and from an analytics perspective when someone starts using tiktok a session is created and all their activity is tracked w/ that session.

There are also user accounts for known people to tiktok. This is not exactly the same as user/password type account and purely about what they know about people.

Lastly, there are devices. They can be identified by request headers, MAC addresses, and other things.

So the magic here is knowing that each of these 3 things can happen in any order, so how can you quickly relate one to the other. So you can probably tie a device identifier to a session every time. When that user creates an account you can relate the device and session to that account from then on. When they log in from a different device, you can remember that device and relate it again.