Every website you go to tracks and learns some sort of information about you. This act in itself is not unethical, but there are some tactics that can ensure a site is being ethical in its practices.
First of all, the website must ask for permission before allowing the user to access the site to make sure the user knows that their information will be collected. Sometimes websites will hide this in a long user agreement so the viewer won’t know what they’re agreeing to, which is less honest and straightforward than asking just about cookies.
Another question of ethics is what the website does with the information it gathers. If this information is only being used for marketing purposes to help tailor advertisements to specific segments of the population, that is within the scope of what the consumer has agreed to. Some websites, however, sell the information they collect to other companies which can put your data at risk of being stolen or corrupted in some way.
All in all, it’s very possible for websites to ethically collect data, and this can even make the shopping experience easier for the consumer! But it’s crucial to keep in mind that at the end of the day, these websites are handling personal data which must be sourced ethically and used with care.