Should a personal site have analytics? Five options compared
From not installing anything to GA4: what each one tells you, whether it needs a cookie banner, the free tiers, and one edge counter that does not record IP addresses.
1. Decide what you need to know first
A portfolio site usually needs to answer only three questions: whether anyone came, which pages they viewed, and where they came from. If you only want the first two, you need no tool that tracks visitors.
You can also install nothing, and write “This site has no traffic analytics” on the privacy page; that sentence is persuasive on its own.
2. Five options
| Option | What you can learn | Privacy | Cookie / consent banner | Cost | Best for |
|---|---|---|---|---|---|
| A. No analytics | Nothing | Best | Not needed | 0 | Only cares about the work itself |
| B. Cloudflare Web Analytics | Page views, popular pages, referring sites, countries, devices | Official docs say it uses no cookies and no fingerprinting | Not needed | Free | The first choice for most people: turn it on in the dashboard and paste one snippet of code |
| C. Build an edge counter yourself | Page views per page, with humans and bots counted separately | Can be built to log no IP addresses and set no cookies | Not needed | 0 within the free tier | Want the numbers shown publicly in the footer, or want to see how many times AI crawlers came |
| D. Self-hosted or paid privacy-focused analytics (tools like Plausible or Umami) | Similar to B, and you can set conversion goals | No cookies | Not needed | Paid, or host it yourself | Later, when you have a newsletter and want to track conversions |
| E. Google Analytics 4 | The most complete: paths, conversions, audiences | Sets cookies and sends data to Google | Requires a consent mechanism | Free | Marketing needs, and willing to build a consent mechanism |
Recommendation: start with A or B. If you install B, add one line to the privacy page: “Page views are counted with Cloudflare Web Analytics, without cookies.”
Notes on E: if you add GA4, load it only after consent: it does not load by default, the footer has an “Analytics settings” link so visitors can choose, and when they opt out, its cookies are cleared. The privacy page should also list what is sent and what is not (for example, URLs are sent with query parameters stripped, and form contents are not sent).
3. Option C in practice: the edge counter on wizerdbache.com
My site uses C, and the footer shows “This page: N views · N bot visits”. The architecture:
訪客打開網頁
→ Cloudflare Worker(只攔網頁,不攔圖片、CSS)
→ 看瀏覽器自報的身分 (User-Agent) 分成:人/機器人/無法判斷
→ D1 資料庫(Cloudflare 的 SQLite)把這一頁的數字加一
→ 把數字直接寫進網頁的頁尾後回傳
→ 不跑任何訪客端的 JavaScript、不放 cookie、不記 IPSeveral points here are worth borrowing:
- Only three tables are stored: per-page totals, daily totals, and daily counts per bot name (for example, “how many times GPTBot came on a given day”). Nothing is stored about “who, when or from where”, so there is no personal data.
- Count what cannot be classified separately: requests without a User-Agent are logged as “unknown” and are not forced into either the human or the bot count.
- A failure does not affect the site: if the database errors or is too slow (a timeout is set), the page still displays normally; only the footer omits the numbers, and one line is written to the error log.
- Prefetch and deploy checks are not counted: browser prefetch requests and test requests made after my own deployment are excluded.
- One health-check URL: it returns today’s total and the database latency, for easy monitoring.
- The numbers are approximate: bots that do not identify themselves are counted as humans. This is stated on the privacy page.
Building this takes code. If you hand it to the AI assistant, require a test for every rule (a human visit adds one, a crawler adds one, deploy checks are not counted, and the page still loads when the database is down).
4. Free tier limits (checked against the official docs on 2026-10-31)
| Item | Free plan | When exceeded |
|---|---|---|
| Worker requests | 100,000 per day (across the whole account), reset at UTC midnight | Depends on the setup: when a Worker is bound to a regular route, it returns Error 1027, and it can be set to skip the Worker on failure (fail open). For a static site that uses run_worker_first so that pages go through the Worker first (as in Option C), those pages return 429 directly and do not fall back to serving the static files, which means the site cannot be opened |
| Worker CPU time | 10 ms per request | — |
| D1 database | 5 million rows read and 100,000 rows written per day, 5 GB total storage | From 2026-09-01, queries over the limit fail until UTC midnight |
| Static assets | 20,000 files per version, 25 MiB per file | — |
The key point: Option C makes every page request go through the Worker, so page views are roughly the same as Worker requests. Going over the limit costs pages returning 429 and the whole site being down until UTC midnight, not just a few missed counts. A personal portfolio is unlikely to reach 100,000 requests in a day, but heavy crawling could do it, so watch the daily total (for example, alert when usage passes half). Images and CSS do not go through the Worker (only the page paths run the Worker first), which saves a lot of quota. B does not pass through your Worker, so it has no such problem.
5. Seeing how many AI crawlers came
You can see this without building your own counter: the AI Crawl Control page in the Cloudflare dashboard lists which AI crawlers have visited and how often (see Domain setup after purchase section 5).
Sources
- Cloudflare Web Analytics (Official)
- Workers limits (Official)
- Static assets: Billing and limitations (run_worker_first returns 429 when over the limit) (Official)
- D1 free tier limit enforcement (2026-09-01 changelog) (Official)
- D1 pricing (Official)
← Previous:Privacy for a personal site: collect nothing by default, then write a page that says so
Next:Security for a static personal site: where the real risks are →
Email subscriptions will open later. For now, you can follow new articles and work with RSS.