Netlify
Netlify analytics without a script. Send your site's traffic logs to MetrikStack with a Netlify log drain and count every page request, bots included.
Netlify Log Drains
stream a site's traffic logs to an HTTP endpoint in near real time. Point one
at POST /v1/logs/netlify and every page request Netlify served becomes a
pageview, without a script on the page or any change to your site.
Log drains are a paid Netlify feature (Enterprise, or the Netlify Analytics / Log Drains add-on, depending on your plan).
Create a source of kind logs for the site in the dashboard to get an
ingest token (in_…).
Set up the drain
- Netlify → your site → Site configuration → Log drains → Add log drain.
- Service:
General HTTP endpoint. - Log type:
Traffic. (Function and edge-function logs may share the same drain; they are skipped server-side.) - Endpoint URL:
https://api.metrikstack.com/v1/logs/netlify - Format:
JSONorNDJSON; both are accepted. - Authorization header:
Bearer in_…
Netlify's UI also allows API keys as query parameters, and every
/v1/logs/* endpoint accepts the ingest token that way:
https://api.metrikstack.com/v1/logs/netlify?token=in_...Use the Authorization field when you can. A token in a URL is visible to
anyone who can read the site's settings, and ends up in logs more easily.
What becomes a pageview
An entry counts when all of the following hold:
- it is a traffic log (
log_typeistrafficor absent); - the method is
GETorHEAD; - the path is not an asset path (same extension and prefix rules as every other source; see Access logs);
- the status is not a 3xx redirect. A 304 counts: the browser checked whether the copy of the page it kept from an earlier visit is still current.
Everything else is counted in the response's skipped figure, not rejected.
Fields map like this:
| Netlify | MetrikStack |
|---|---|
path (or the path of url) | path + query |
url | hostname |
method | method |
status_code | status_code |
user_agent | user agent (bot classification, device, browser) |
referrer | referrer |
client_ip | visitor hash + GeoIP country, then dropped |
country | country, when GeoIP has nothing |
request_id (or x-nf-request-id) | request_id |
timestamp (RFC 3339) | event timestamp |
If you turn on Netlify's option to exclude PII, user_agent and client_ip
are left out of the logs. Pageviews still arrive, but visitors can no
longer be told apart and device, browser and country reports stay empty, so
leave the option off if you want visitor counts. MetrikStack never stores the IP itself
(see Privacy & data retention).
Drains and the request-id merge
Netlify's request_id is the platform's own id, unrelated to the
X-MetrikStack-Request-Id that the Node SDK sets, and a drain entry carries
none of your application's response headers, so the two cannot be matched.
Run the drain as the site's only source and every page request in the
traffic log is a pageview. Run it next to the tracker script and merging
falls back to the
60-second dedupe window on
(site, visitor, path).
The drain sees cached and bot traffic, which never reaches a browser script; the script sees screen size, language and time on page. Running both works well, but pageviews are matched by the dedupe window and not by request id.
Response
{ "accepted": 42, "skipped": 118, "rejected": [] }Vercel
Vercel analytics without a script. Point a Vercel Log Drain at MetrikStack and every page request served by Vercel is counted, bots and AI crawlers included.
Cloudflare
Cloudflare web analytics that count cache hits and bots. Install the MetrikStack Worker on your zone in one step with a scoped API token.