Vercel Log Drain
Have Vercel forward your project's request logs to Rankealo. Nothing runs on your site, and crawler visits to cached and static pages are counted too.
Vercel Pro or Enterprise only
Drains are available to teams on the Pro and Enterprise plans. On the Hobby plan, use the Next.js middleware instead.Prerequisites#
- A Vercel team on the Pro or Enterprise plan, and permission to manage its Drains.
- The Vercel project (or projects) that serve your site's production domain.
- The URL shown in Rankealo → Traffic → Agent Analytics in the app. It carries your site key, so you paste it into your host's dashboard yourself; it never appears in these docs or in the "Copy for Agent" prompt.
Steps#
- 1
Copy the drain URL
In Rankealo, open Traffic → Agent Analytics, pick Vercel Log Drain, and copy the Drain URL. It carries your site key as a query parameter, so the drain needs no custom headers. Because it contains your key, it is only shown there, never in these docs or in the "Copy for Agent" prompt. - 2
Add a drain
In Vercel, open Team Settings → Drains and click Add Drain. Choose the Logs data type. - 3
Pick projects and sources
Name the drain and select the project(s) that serve your site. In the log settings keep the static, lambda, and edge sources and the production environment. Leave sampling at 100% so no crawler visit is dropped. - 4
Set the destination
Choose Custom Endpoint, paste the drain URL, and pick the JSON format (NDJSON works too). You can leave the signature secret as generated. - 5
Create the drain
Click Create Drain. Vercel tests the endpoint right away; it answers 200 when the key is valid. Logs then arrive in batches.
The settings in one place:
# Vercel: Team Settings > Drains > Add Drain
Data type: Logs
Projects: the project(s) that serve your site
Sources: static, lambda, edge (optional: external, redirect)
Environments: production
Sampling: none (100%)
Destination: Custom Endpoint
Endpoint URL: the Drain URL shown in Rankealo → Traffic → Agent Analytics
(it carries your key, so paste it yourself)
Format: JSON (NDJSON also works)
Custom headers: none
Fields read#
- proxy.methodOnly GET and HEAD are kept.
- proxy.hostMust belong to your site.
- proxy.pathPath; the query string is dropped.
- proxy.userAgentIdentifies the crawler.
- proxy.clientIpHashed on arrival, never stored raw.
- proxy.statusCodeStatus code Vercel returned.
- proxy.timestampWhen the request happened.
Only log entries that describe a request (they carry a proxy object) are read. Build output and function console.log lines are ignored, duplicate log lines are not double counted, and humans and unknown user agents are dropped before anything is stored. Raw log lines are not kept.
Limitations#
- Requires a Vercel Pro or Enterprise team.
- Only the projects you select send logs. Adding a new project later means editing the drain, unless you chose all projects.
- Logs arrive in batches, so hits show up a little after the crawler visit, not in real time.
- Very large batches may be truncated. Vercel caps batches at 5 MB, which keeps normal traffic well inside the limit.
- If your team hides IP addresses in drains (Security & Privacy → IP Address Visibility), hits arrive without an IP. Everything else still works.
- The key sits in the drain URL, so treat the drain configuration like a secret. If it leaks, press Regenerate key in Agent Analytics Setup (the old key stops working at once) and update the drain with the new URL.
- Hits are marked as claimed identities (user agent only); Vercel logs carry no verified-bot flag.
Confirm data is flowing#
- 1In Rankealo, open Traffic → Agent Analytics.
- 2Press Check now in step 3. Once a crawler has visited, it shows Receiving data with the time of the last hit.
- 3Open the Bot traffic tab to see hits by crawler and by page.
The first hit depends on when a crawler next visits, which can take up to 24 hours. To test right away, request a page with a crawler user agent, for example curl -A "GPTBot/1.2" https://www.your-site.com/, then press Check now. A test like this is recorded as a claimed identity, like any hit without CDN verification.
Troubleshooting#
Vercel says the endpoint test failed+
The drain is active but nothing shows up+
Vercel marks the drain as errored+
Still stuck? Contact support
