πŸ˜” Failed to add PV to My Website

J.Gong

2025-08-18

0.58min

πŸ˜” Failed to add PV to My Website

Believe it or not, the very first feature on my old Jekyll site in 2015 was a PV (page view) counter πŸ‘€.
But when I rebuilt the site with Gatsby, I thought β€œeh, too easy, I’ll add it later…” β€” and then… I just never did πŸ˜‚.

A lot of sites use δΈθ’œε­ for PV counts, but I figured: why not build my own? πŸ€“
Turns out, it’s super simple β€” just two GET requests:

  • one returns an image πŸ–ΌοΈ
  • the other returns a JSON with the count πŸ“Š

Now it’s running on Cloudflare Workers + KV, and you can spot the little πŸ‘οΈ with a number on this site showing the PV count.

If you’re curious, here’s the health check link βœ…


However, this is me from 20th. As I mentioned, using KV turns out to be a terrible idea 🫨. Only in two days, I used up all my quota 🫠. Now, I have changed the PV service to goatcounter.