I’m not a fan of being tracked for purposes I find intrusive, but…
Tracking on an e-commerce site is mostly necessary to keep track of what one might have placed in one’s shopping cart. Common ways to do this are with cookies and session tokens.
With cookies, your cart contents would be kept as a cookie on your browser, which starts to get messy and pose security issues. Cookies are great for sites like GDF forum that keep you logged in by means of a browser cookie that authenticates you each time you load a page. Cookies are less great for keeping track of complex shopping carts and, besides, on an e-commerce site they can present security problems.
User sessions using tokens are a little different. With them the store assigns each new visitor a unique session number. Each time the visitor calls up a new page, only that session number is transmitted from one’s browser to the server. As the shopper moves through the site, adding things to the cart, removing things, adding coupons, changing quantities, etc., the only thing that moves from the browser to the server is an anonymous token number that the server on the other end keeps track of it instead of writing everything into a browser cookie.
Yes, merchants can misuse this to build up a profile of particular users for marketing purposes, which isn’t necessarily good. Besides, with any sale, no matter how it’s tracked, the merchant has a record of everything anyway. However, that’s really not the main purpose — without keeping track of a shopper’s behavior as that shopper interacts with the website, shopping online in the way that most people have come to expect wouldn’t be possible.