> For the complete documentation index, see [llms.txt](https://docs.airops.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.airops.com/insights/settings/netlify-agent-analytics.md).

# Netlify Agent Analytics

Connect your Netlify site to AirOps to track AI bot traffic. You add a **Netlify Log Drain** that streams edge traffic logs to AirOps, which classifies AI bot visits (ChatGPT, Claude, Perplexity, Google, and more) and surfaces insights in your Agent Analytics dashboard.

Setup is a one-time manual step in the Netlify dashboard. Log Drains are a **Netlify Enterprise** feature. No site tag or client-side script is required.

***

### Prerequisites

* An active **AirOps** account with Agent Analytics enabled
* A **Netlify Enterprise** account (Log Drains are not available on Free, Personal, or Pro plans)
* A **Netlify site** serving your website
* A **Brand Kit** in AirOps for that site. Set its Brand URL to your site's domain so page-level breakdowns resolve (configurable under Context > Brand Kits > Brand URL)

If you're not sure whether your brand kit is set up correctly, check with your AirOps Customer Success contact before setting up the drain.

***

### Step 1: Get your AirOps endpoint and token

In AirOps, open **Insights > Traffic** and click **Set up Agent Analytics**, then choose **Netlify**. Copy:

* the **ingest endpoint URL** for your brand kit, and
* your **workspace API token** (used as the `Authorization: Bearer` value).

### Step 2: Add a Log Drain in Netlify

In Netlify, go to your team's **Logs & Metrics > Log Drains > Add log drain**, then:

1. **Service:** General HTTP endpoint
2. **Log types:** Traffic only (leave function, edge, deploy, and firewall logs off)
3. **Format:** NDJSON
4. **Endpoint URL:** the AirOps endpoint from Step 1
5. **Header:** add `Authorization: Bearer <your token>`
6. **Exclude PII:** leave this **off** (see the warning below)
7. Click **Connect** to save the drain.

{% hint style="warning" %}
Leave **"Exclude PII" off**. Netlify's PII-exclusion option drops the User-Agent and client IP from traffic logs. AirOps identifies AI agents from the User-Agent, so with PII excluded no bot traffic can be classified and your dashboard stays empty. Keep it off for Agent Analytics.
{% endhint %}

### Step 3: Verify the Connection

In AirOps, navigate to **Insights > Settings > General** for the brand kit and scroll to the **Connected Integrations** section. You should see a **Netlify** row with a green **Connected** badge.

Data appears as AI agents crawl your tracked pages.

{% hint style="info" %}
Test with a real, existing path on your site. Requests to non-existent pages can be served from Netlify's edge cache without reaching the drain, so a 404 test won't produce data. Also confirm the drain's log type is set to **Traffic**.
{% endhint %}

***

### Troubleshooting

| Symptom                                                                 | Likely Cause                                               | Fix                                                                                                                               |
| ----------------------------------------------------------------------- | ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| Netlify row shows **Connected** but no data appears in Insights Traffic | No AI bot has hit the site yet, or "Exclude PII" is on     | Confirm real traffic is reaching the site, and turn off "Exclude PII" on the drain.                                               |
| Raw traffic shows up but nothing is classified                          | "Exclude PII" is on, so the User-Agent is missing          | Edit the drain in Netlify and turn off PII exclusion. AirOps needs the User-Agent to identify bots.                               |
| Page-level data is missing in Page360                                   | Your brand kit's domain doesn't match the site             | In AirOps, open Brand Kit settings and confirm the Brand URL matches the domain your Netlify site serves.                         |
| Drain configured but no rows after a few minutes                        | You tested a path that 404s, or the log type isn't Traffic | Visit a known-good path that exists in your deployment, and confirm the drain's log type is **Traffic** (not function/edge only). |
| Can't find Log Drains in Netlify                                        | Your team is not on an Enterprise plan                     | Log Drains require **Netlify Enterprise**. Upgrade before setting up.                                                             |

***

### Plan Requirements

Netlify Log Drains are available on the **Netlify Enterprise** plan only. Free, Personal, and Pro plans cannot create drains; your team needs Enterprise before setting this up.

Netlify does not publish a separate per-GB charge for Log Drain egress; any data cost is part of your Netlify Enterprise agreement. To keep volume down, drain **Traffic logs only**.

***

### Security and least-privilege setup

#### Permissions required to set up

**On Netlify:** a team member able to manage Log Drains on your Enterprise team can add the drain.

**On AirOps:** the user must be signed in to AirOps and a member of the target workspace; any AirOps role works.

#### Runtime authentication

No user session is involved in any drain delivery. Each delivery authenticates with a **Bearer token** in the `Authorization` header, which is your **workspace's AirOps API key**, entered into the drain configuration during setup. The token is workspace-level, not user-level. There is no separate signing secret to manage.

#### Token rotation

The workspace API key is rotatable in-app under **Account > Workspace > API Key** (requires AirOps workspace admin role). Two things to understand before rotating:

* The Netlify drain has the previous token in its outbound `Authorization` header. After rotation, update the drain's header in Netlify with the new token, otherwise deliveries will start failing authentication.
* The same workspace API key authenticates other AirOps APIs (Public API, MCP server, SDK). Rotating it affects all of those, not only Netlify.

#### What this integration does not do

* It only receives the traffic logs the drain sends. It has no access to your Netlify account, environment variables, build logs, or deploys.
* It does not write back to your Netlify account. After setup, AirOps only receives data from the drain.

If your security review needs additional detail, contact AirOps Customer Success and we can walk your team through the data flow at the implementation level.

***

### Disconnecting

To remove the Netlify integration:

1. In Netlify, open **Logs & Metrics > Log Drains** and remove the AirOps drain.
2. In AirOps, disconnect **Netlify** from the data-source picker.

Your historical Netlify data stays in AirOps after disconnecting. To resume tracking, set the drain up again.

***

### What AirOps Tracks

Once connected, AirOps automatically:

* **Ingests all Netlify-served requests** carried in the traffic logs: page views, assets, API calls
* **Classifies AI bot traffic:** identifies visits from ChatGPT, Claude, Google, Perplexity, Meta, Apple, Bing, Bytedance, Common Crawl, and others
* **Categorizes crawl behavior:** distinguishes AI training crawlers (GPTBot, ClaudeBot, etc.), AI search fetches (PerplexityBot, OAI-SearchBot, etc.), and user-initiated AI browsing (ChatGPT-User, Claude-User, etc.)
* **Surfaces analytics:** traffic breakdowns, bot-vs-human ratios, and crawl trends in your dashboard


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.airops.com/insights/settings/netlify-agent-analytics.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
