> ## Documentation Index
> Fetch the complete documentation index at: https://www.usenotra.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Track AI crawlers with a Vercel log drain

> Send your Vercel request logs to Notra with a log drain and track AI crawlers, AI-cited fetches and AI referrals without changing your code.

A Vercel log drain sends the request logs of your deployments to Notra, which keeps the AI traffic and throws the rest away. You don't install a package or touch your code, and setup takes about five minutes in the Vercel dashboard.

> [!NOTE]
>
> Drains are available to Vercel teams on the Pro and Enterprise plans. On Hobby, use the [Next.js tracker](https://www.usenotra.com/docs/analytics/install/nextjs.md) instead.

## Known limitations

A drain sees less of each request than the tracker does, because Vercel's request logs carry the method, URL, user agent, referer, client IP and status code but no other request headers. Without the `Accept` header Notra can't tell when an agent asks for Markdown, and without the fetch metadata and client hint headers it can't catch agents that pose as a regular browser. Requests are still classified by user agent and referer, which covers the declared crawlers and assistants and every referral from an AI answer.

A drain also only observes traffic, so it can't tag the links in the Markdown you serve for [journey tagging](https://www.usenotra.com/docs/analytics/journeys.md). Requests that already carry an `ntr` tag still join their journey, but if you need Markdown detection or tagging, the [tracker package](https://www.usenotra.com/docs/analytics/install/nextjs.md) is the better fit.

**1. Get your token and endpoint**

Open **Analytics** in the GEO sidebar, stay on the **Agent** tab and pick **Vercel log drain** at the top of the install panel. It shows the endpoint URL and a ready-made `Authorization` header that carries your project's tracking token.

The setup endpoints return the drain endpoint under `drainUrls.vercel`, and the token endpoint adds `token`:

```bash theme={"system"}
curl -X POST "https://api.usenotra.com/v1/geo/ingest/token?projectId=$PROJECT_ID" \
  -H "Authorization: Bearer $NOTRA_API_KEY"
```

**2. Add the drain**

In Vercel, open **Team Settings**, then **Drains**, click **Add Drain** and choose **Logs**. Select the projects that serve this site, keep the `static`, `lambda` and `edge` sources and pick the `production` environment. Leave sampling at 100% because a sampled drain drops AI requests along with everything else.

**3. Configure the endpoint**

Choose **Custom Endpoint** and paste the endpoint URL:

```text theme={"system"}
https://ingest.usenotra.com/api/geo/drains/vercel
```

Pick **JSON** or **NDJSON** as the format and add your token under **Custom Headers**:

```text theme={"system"}
Authorization: Bearer <your tracking token>
```

You can leave the signature verification secret as it is, since Notra authenticates the drain with the token.

**4. Create and verify**

When you click **Create Drain**, Vercel sends a test request and Notra answers it with `200`. The **Agent** tab switches from the install panel to the dashboard once the first AI crawler or referral arrives, which usually takes a few seconds after a crawler visits.

## How Notra reads the drain

Notra rebuilds each request from the `proxy` block of a log line and drops anything that isn't a `GET` request for a page, so static assets, `/api` routes and build logs never count. Notra counts a request that writes several log lines once. Every request then goes through the same checks as tracker events. It has to belong to one of the project's [tracked domains](https://www.usenotra.com/docs/analytics/tracker-reference.md), and Notra stores only AI crawlers and AI referrals and discards human requests on arrival.

A drain that covers several projects is fine, because Notra drops requests for hosts outside the project's domains, and it drops preview deployments on `*.vercel.app` the same way.

## Next steps

> [card] [Cloudflare Logpush](https://www.usenotra.com/docs/analytics/install/cloudflare-logpush.md)
>
> Track sites that sit behind Cloudflare, wherever they are hosted.

> [card] [No AI traffic yet](https://www.usenotra.com/docs/analytics/troubleshooting/no-ai-traffic.md)
>
> What to check when nothing shows up.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.