Learning objectives
After reading this article you will be able to:
- Understand how server-side collection differs from an analytics script in the browser
- Know what you can and can't measure without cookies
- Judge how accurate the numbers are and when to add a product analytics tool
The usual way to measure a website is to paste an analytics script into the HTML. It runs in the visitor's browser, stores an identifier in a cookie and sends events to another server. It works, but it has a cost: more JavaScript on the page and numbers that vanish when the visitor runs a blocker.
Cookieless analytics starts from a different source: the HTTP requests your server already receives. Knowing where the data comes from tells you what these numbers count well and what they will never count.
What is cookieless analytics?#
It is a way to measure traffic without setting or reading cookies (or localStorage) in the browser to recognize the visitor. There are two families:
- Server-side collection: the numbers come from the records of requests that reach the web server, the proxy or the CDN. There is no script on the page at all.
- Cookieless script: a small script sends events but doesn't keep an identifier in the browser.
This article covers the first, which is the one that differs most from traditional analytics. "Cookieless" is about what stays in the browser. It doesn't mean "no data": every HTTP request carries the source IP, the user agent and the requested URL.
How does collection from HTTP logs work?#
Every time a browser asks for a page, it sends the method, the path and headers such as User-Agent and Referer (spelled that way in the HTTP specification). The server writes one line. In nginx's combined format, it looks like this:
203.0.113.7 - - [29/Nov/2026:14:03:12 +0000] "GET /pricing?utm_source=newsletter HTTP/2.0" 200 18234 "https://www.google.com/" "Mozilla/5.0 (iPhone; ...)"Each field becomes a metric:
- Path: the most visited pages. The query string carries campaign parameters such as
utm_source. - Status: 200, 404, 500. It shows broken links and errors the page would never get a chance to report.
- Referer: where the visit came from.
- User-Agent: browser, operating system, device type and robots that identify themselves.
- IP: the country, through a geolocation database, and the internet provider.
- Timestamp: the series over time.
Before becoming a chart, the data gets cleaned: drop requests for assets (CSS, JavaScript, images) and health checks, separate bots, and group requests into visits. For that grouping, tools usually use an inactivity window. GA4, for example, ends a session after 30 minutes of inactivity by default.
| Browser script | Server-side collection | |
|---|---|---|
| Where it runs | In the visitor's browser | On the server, proxy or CDN |
| Page weight | One more script | None |
| Blockers | Can block the script | Can't reach the page request |
| Visitor without JavaScript | Not counted | Counted |
| Bots | The ones that don't run JavaScript disappear | Show up and need filtering |
| Clicks, scrolling, time on page | Yes | No |
| Same person across sessions | With a cookie or login | No |
What can you measure?#
Everything that is in the request:
- Visits and requests over time, with peaks and drops.
- Routes that get the most traffic and the ones returning 404.
- Countries, keeping in mind that IP geolocation is approximate and VPNs fool it.
- Referrers, with one limit: by default, browsers use the
strict-origin-when-cross-originpolicy, which sends only the origin between different sites. You seegoogle.com, not the page or the search term. Parameters likeutm_sourcestill work, because they are in the URL itself. - Browsers, operating systems and devices, read from the user agent.
- Status codes, which tie traffic to the health of the site. A spike of 5xx at 2 PM explains a drop in visits at the same hour, and 500, 502, 503 and 504 errors helps you read each one.
- Bots, including the ones pretending to be someone else. A user agent can be faked, so Google documents how to confirm Googlebot: a reverse DNS lookup on the IP to check the domain, then a forward lookup to check that it resolves back to the same IP.
What can't you measure?#
The limit comes from having no identifier. Without one:
- Unique users across sessions. The IP changes (phone, home Wi-Fi, office Wi-Fi), many people share one IP behind a company or carrier network, and the same person uses a phone and a laptop. That is why these tools talk about visits, not people.
- Per-person funnels. "Who saw the pricing page and signed up three days later" requires tying requests to someone, which only happens with a login and your own system's data.
- Events without a request. Clicks, scrolling, time on page, a video that played: none of it reaches the server unless it triggers a request.
- Navigation inside a SPA. In a React or Vue app, switching screens doesn't ask the server for new HTML. Server-side collection sees the first load and the API calls, not each screen. See how the models differ in SSR vs SSG vs static.
How accurate are the numbers?#
No method measures the truth. Each one errs on a different side:
- Blockers work against the script. uBlock Origin, for example, blocks trackers by default with lists such as EasyPrivacy. Safari deletes cookies created in JavaScript after 7 days without interaction with the site, so a frequent visitor can show up as new in script-based analytics. Server-side collection depends on none of this.
- Bots work against the server. Robots that would never run a script appear in the logs. Without a filter, they inflate visits.
- Caching hides requests. Whatever the browser or a CDN serves from cache never reaches the origin server. A count taken at the origin sees less than one taken at the edge.
- Prefetch inflates. Browsers can fetch a page before the click. MDN explains that these requests carry the
Sec-Purpose: prefetchheader, which the server can treat differently when counting visits.
So the number from a script and the number from the server won't match, and that is expected. Pick one source as your reference and compare trends within it.
When should you add a product analytics tool?#
Server-side collection answers traffic questions: how much, from where, to where and with what errors. Product analytics tools answer what people do inside the app: funnels, retention, feature usage, A/B tests. If your site is a blog or a landing page, traffic is usually enough. If it is a product with user accounts, you will want both.
A low-friction path is recording business events in your own backend: sign-up, purchase, cancellation. They already pass through your server, live in your database and are counted once, without relying on the browser. Browser-based product tools come in when you need interface interactions. To tie it all together, your application logs are usually the bridge between the request and the event.
Does cookieless mean no personal data?#
Not necessarily. The IP, the user agent and the URL arrive with every request, and a URL can carry more than it should, such as an email address in a parameter. On the technical side, three habits help: keep personal data out of URLs, decide how long logs are kept and limit who can read them.
The legal side is outside the scope of this article. Consent and data protection rules vary by jurisdiction and depend on how you use the data and what the rest of the site does. To know what applies to you, check with your data protection authority or a lawyer.
How to do this on Square Cloud#
Every Square Cloud plan includes cookieless web analytics for applications published as a site. The data is collected on the server from HTTP traffic, with no script or tag in your code: visits, routes, countries, referrers, browsers, operating systems, devices, status codes and verified bots, over ranges of up to 7 days.
On the Pro and Enterprise plans, you also get p50, p95 and p99 latency, at the edge and at the origin, plus HTTP request logs, which help you match a drop in visits with errors or slowness. The limits described above still apply: the numbers come from HTTP requests and count visits, not people, so funnels and click events belong in your backend or a product analytics tool.
See what each plan shows on the Analytics page.
Website hosting
Static and SSR sites with automatic TLS and a global CDN
FAQs
Can cookieless analytics count unique users?
Not with certainty. Without an identifier stored in the browser, there is no way to know that two visits on different days came from the same person. These tools count visits and requests, and any count of people is an estimate.
Do ad blockers affect server-side analytics?
Not in the same way. They block tracking scripts and domains in the browser, but the page request has to reach the server for the site to load, and that request is what gets recorded.
Can I track button clicks without a script?
No. A click that doesn't trigger a request to the server never shows up in the logs. For interface events you need a script in the browser, or to record the event in your own backend.
Does cookieless analytics remove the need for a consent banner?
Server-side collection stores nothing in the browser, but it still handles data such as the IP address, and consent and data protection rules vary by jurisdiction. This article isn't legal advice: check with your data protection authority or a lawyer.
More in Websites
See all 25 articles- What is a static site (and how to host one)A static site is a set of ready-made HTML, CSS and JavaScript files served the same to every visitor. Learn how it works, when to use one and how to host it.
- How much does it cost to host a website?Hosting a website costs anywhere from nothing to a few dozen dollars a month. See what goes into the bill: hosting, domain, traffic and extras, with real limits.
- How much does static site hosting cost?Hosting a static site costs between zero and a few dozen dollars a month in most cases. See how traffic sets the price, with step-by-step math.
- How much does it cost to host a Next.js app?Hosting a Next.js app costs from zero with a static export to tens of dollars a month with a server. See the billing models, traffic math and hidden costs.