They do it like they do it on sesame street. The Cookie Monster with help from the Count. When you go to a web site if you are not using a VPN that masks the chip ID of your device or you have not cheated by masking the chip ID's by running a virtual machine of the operating system that puts out fake data, then the type of operating system, the type of device and the unique chipset ID of your device are all available on line in the communication data. All communication devices like computers, cell phones, tablets use unique chipset identifiers so that the data exchange can go to the right place and users can instantly be identified upon starting a conversation. Cookies can store your user preferences machine identification and time of contact and certain parts of the history of your conversations, they are used so that you can go back to exactly where you were and the website, forum or other communication platform that you are communicating with can keep track of what the users preferences are.
Communication data tracking is a two edged sword it can enhance communications on a site or if the site is malicious attack site or porn site run by crooks and organised crime these methods can be used to keep track of millions of suckers at the same time. For sites like Amazon data and communications tracking is essential for making online sales work and speed up the process of keeping track of millions of purchases and sales.