A view count that tracks nothing
Our case study for Al-Abrar Muslim Association carries a small number next to its video: an eye icon, a count, nothing else. It looks like the view count on any social platform. It isn’t built like one.
This site runs no analytics. That’s stated plainly on our privacy page, and it was a deliberate choice from the first build: no cookies, no trackers, nothing that follows a visitor around. A view counter sounds like exactly the kind of thing that choice rules out. So before writing any code, the real question was whether we could show a real number without keeping any of the things we’d decided never to keep.
What a view had to mean
A count that goes up when a page merely loads isn’t a view, it’s a hit, and the two get confused constantly. A crawler indexing the page counts. A tab left open in the background counts. Someone who bounced off the page in half a second counts the same as someone who watched the whole thing.
So a view is defined narrowly: three seconds of actual video playback, counted once per visit to the page. Not three seconds since the page loaded. Three seconds where the video itself has been playing, measured off the video element’s own clock. Looping the video again in the same visit doesn’t add a second view; that would turn an engaged viewer into an inflated number, which defeats the point of a measurement meant to be trusted.
What we refused to store
The obvious way to build “once per visitor” is a cookie, or an ID written to local storage. We didn’t want either, so the counter doesn’t try to recognise the same visitor twice. It counts the same way Cloudflare’s own access log does: this event happened, add one, nothing about who.
That has a real cost. The same person watching on Monday and again on Thursday adds two views, not one, exactly like a plain hit counter from 1998. We decided that was an acceptable trade for keeping the promise on the privacy page intact. A counter that quietly started fingerprinting visitors to get a more accurate number would have been a worse outcome than a number that’s occasionally a little generous.
Keeping bots out, without trying to be clever about it
The one place we did filter was automation. Lighthouse, our own test suite, and search engine crawlers all load the page and, in some cases, even let a video element run. None of those should count as a view, and the fix was narrow rather than a general bot-detection system: a single check, navigator.webdriver, which is true in every browser driven by automation (Playwright, Selenium, Lighthouse’s own Chrome instance) and absent in an ordinary visitor’s browser. It isn’t bulletproof against someone determined to fake a view, but it quietly removes the automated traffic that would otherwise be the majority of early counts on a brand new page.
Where the number actually lives
The count itself sits in Cloudflare KV, a small key-value store: one key, one number, read and incremented by a Cloudflare Pages Function. The function checks the request looks like it came from our own page before it adds anything, the same origin check our contact form uses for the same reason, and otherwise does nothing clever. No visitor record, no timestamp, no IP address kept anywhere. If someone asks what we hold against their visit to that page, the honest answer is: one shared number went up by one, and nothing else was written down.
That also sets the limits of what this can ever tell us. It can’t say how many people watched, only how many times the three-second threshold was crossed. It can’t be filtered by date, country or device, because none of that is recorded. If we ever want that kind of detail, it needs a proper, disclosed analytics tool, not a counter stretched past what it was built for.
What this is for
It isn’t meant to replace analytics, and it isn’t a vanity metric either. It exists because a fundraising video for a masjid’s renovation appeal is more convincing with a real number next to it than with none, and because “real” has to include how the number was made, not just what it displays. A view count that only works by watching its own visitors more closely than we’re willing to is the wrong trade for a studio whose own privacy page says it tracks nothing. This one doesn’t, and that’s the whole feature.
Related: website design and development, animation.