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.
- Your site token and website id from Bot traffic → Agent Analytics Setup in the app. The snippet there already has both filled in; the examples on this page use
YOUR_SITE_TOKENandYOUR_WEBSITE_ID. See the HTTP API reference for the full payload.
Steps#
- 1
Copy the drain URL
The drain URL carries your website id and token as query parameters, so the drain needs no custom headers:urlhttps://app.rankealo.ai/api/ai-visibility/crawler-hits/ingest?websiteId=YOUR_WEBSITE_ID&token=YOUR_SITE_TOKEN - 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 website id and token match. 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: https://app.rankealo.ai/api/ai-visibility/crawler-hits/ingest?websiteId=YOUR_WEBSITE_ID&token=YOUR_SITE_TOKEN
Format: JSON (NDJSON also works)
Custom headers: none (the URL carries website id YOUR_WEBSITE_ID and your token)
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, several log lines from the same request count once, 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.
- Each batch keeps up to 500 crawler hits. Vercel caps batches at 5 MB, which keeps normal traffic well inside that.
- If your team hides IP addresses in drains (Security & Privacy → IP Address Visibility), hits arrive without an IP. Everything else still works.
- The token sits in the drain URL, so treat the drain configuration like a secret. If it leaks, contact support to rotate it.
- Hits are marked as claimed identities (user agent only); Vercel logs carry no verified-bot flag.
Confirm data is flowing#
- 1In Rankealo, open Bot traffic → Agent Analytics Setup.
- 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
