withPageViews, a fetch-handler wrapper that reports each page-content request to Page views. Mount it around the handler that serves your marketing site; agents, crawlers, and people all get your site exactly as before, and each page load is reported in the background.
It implements one contract:
- Only
GETrequests to non-asset paths are reported; assets and every other method pass through unobserved. - The handler runs first, so the beacon carries the real response status and the request duration. The visitor’s
User-Agent,Accept, and connecting IP are forwarded for server-side classification. - The beacon is fire-and-forget and fails open. A missing key, a network error, a non-204, a timeout, or a malformed report is handed to
onErrorand swallowed. The middleware never delays or breaks the page.
Standalone: no client required
Page views needs only the seller id and azc_ key with the page-views:write scope. Unlike the usage or Agentify surfaces, there is no createSeller and no signing secrets — a site that only reports page views wires up nothing else.
Options
Only the request’s path is reported, never its query string, so tracking parameters never reach ZeroClick.
Failing open, observably
The middleware exists to add a measurement, never to add an outage or a delay: any error on the reporting path leaves the response untouched. That silence is deliberate, and it means a misconfigured key looks exactly like a working page — so wire the error hook to your logger:Other stacks
Any language or framework can report page views by calling the REST endpoint directly from the request that serves each page — the same body the middleware sends, once per page-contentGET.
Next steps
REST endpoint
The underlying request: body, response, and errors.
Overview
What is captured, how viewers are classified, and the key scope.