How to Track Visitors on a Static HTML Page
You published a page and now the obvious question arrives: is anyone actually looking at it? A static HTML file doesn't run code, so it can't count visitors by itself. The counting has to happen somewhere else — either at the host that serves the file, or in the visitor's browser. Here are the three realistic ways to do it.
Option 1: Stats built into your host
The simplest option is a host that counts visits for you. Because every request for your page passes through the server that stores it, that server can tally views without any code on your side. hdply does this: each site has a visitor count you can open from your dashboard, so you get the basic number — how many people opened the page — with nothing to install and no third-party script slowing the page down.
This is enough for most single pages. If all you want to know is "did the link I shared get opened, and roughly how often?", built-in stats answer it.
Option 2: A privacy-friendly analytics script
When you want more — referrers, countries, which pages within a site, trends over time — you add a small analytics script to your HTML. Lightweight, cookie-free tools like Plausible, Fathom or GoatCounter are popular for static sites because they add a single tag and don't drag in the weight (or the privacy baggage) of heavier platforms.
You paste one line into the <head>, for example:
<script defer data-domain="your-site.hdply.com"
src="https://plausible.io/js/script.js"></script>
Redeploy the page and visits start appearing in that tool's dashboard. Most of these services are paid but cheap; GoatCounter has a free tier for personal use.
Option 3: Google Analytics
Google Analytics (GA4) is free and powerful, and works on a static page the same way — a snippet in the <head>. The trade-off is complexity and privacy: it collects a lot, the dashboard is built for large sites, and in some regions you'll need a cookie-consent banner to use it lawfully. For a personal page it's usually overkill; for something you're trying to grow and measure seriously, it's the industry standard.
Which one should you use?
- Just want the visit count? Use your host's built-in stats — nothing to add.
- Want referrers and countries without the bloat? Add a privacy-friendly script.
- Running a real growth effort? Google Analytics, and accept the setup.
Whatever you choose, add analytics after the page works, not before — a tracking script should never be the reason a page loads slowly.
Related: How to put an HTML file online · Essential meta tags for a single page