Putting a counter on a site with no server
Static hosting has quietly become the sensible way to put a small site on the internet. GitHub Pages, Codeberg Pages, Neocities, or a folder of files on any cheap host: no database, no server-side language, nothing to update, nothing to get compromised.
It has exactly one gap. There is no server log you can read, and no way to run anything that would count for you. You publish, and then you have no idea whether anybody came.
This is the situation a visitor counter was invented for, and it is why they are not actually obsolete.
What you do
Paste the snippet from your statistics page into your HTML, at the spot where you want the counter to appear. That is the whole procedure. It works because the counter is an image and a small script — two things that any static host serves without knowing or caring what they are.
The counting happens on our server. Your host stays a folder of files.
Do not copy the script into your repository
This is the one piece of advice worth the whole post, because static-site habits push hard the other way. Vendoring your dependencies into the repo is normally good practice — it is reproducible, it survives an upstream disappearing, and it saves a request.
Do not do it here.
A copied script is frozen at the moment you copied it. It keeps doing whatever it did that day, forever, on every visit, and nothing anybody does upstream can reach it. That is not a hypothetical: when the screen resolution was removed from the counter this year, copies of the old script kept sending it, and the only way to end the collection was to make the server refuse the value from anybody at all.
The same applies to security fixes, to changes in what gets sent, and to anything else that ought to reach your visitors. Link the script. It is one request, it caches, and it stays current.
What you get, and what you do not
You get visitor counts, days, countries, browsers, referring domains, your most-visited pages, and a live view of who is on the site right now. For a personal site, a project page, or a small shop front, that is usually the entire set of questions.
You do not get log analysis, because there is no log. You do not get anything about requests that fail, files that 404, or bandwidth. If those matter to you, static hosting was already the wrong shape for the problem.
One more thing that suits static sites
Nothing here needs an account. There is no signup, no password to store in a repository, and no key to leak into a public commit — a category of accident that static-site projects are unusually good at having.