That does not matter, at least in the EU where citizens are protected by the GDPR. Article 6 of the GDPR:
Processing shall be lawful only if and to the extent that at least one of the following applies:
(a) the data subject has given consent to the processing of his or her personal data for one or more specific purposes;
"his or her personal data"
Analytics is not personal. No one shares their names or social security number. And I strongly agree with people above mentioning The Visitor is the requester. We provide services, they use it, we want to understand what we are doing by checking analytics. Nothing immoral about this.
* ‘personal data’ means any information relating to an identified or identifiable natural person (‘data subject’); an identifiable natural person is one who can be identified, directly or indirectly, in particular by reference to an identifier such as a name, an identification number, location data, an online identifier or to one or more factors specific to the physical, physiological, genetic, mental, economic, cultural or social identity of that natural person;*
In the legal opinions that the EU provides with the GDPR, random tokens that are associated with a person are PD. An IP address is also considered personal data:
https://ec.europa.eu/info/law/law-topic/data-protection/refo...
Nothing immoral about this.
What is ethical is a personal opinion, but collecting personal data (following the definition above) is simply not legal without consent in the EU.
(f) processing is necessary for the purposes of the legitimate interests pursued by the controller or by a third party, except where such interests are overridden by the interests or fundamental rights and freedoms of the data subject which require protection of personal data, in particular where the data subject is a child.
General analytics on a website are probably not covered under f, since it is not necessary and not what you’d expect when you visit a website to which you have no customer relation.
There are clear cases where one has to collect data, even without consent, such as fraud prevention.
However, OP does not understand why you are so entitled to want to use their website for free, and then also want to tell them that they is not allowed to make note of you having done so.