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

# Set up Bot Analytics

> Connect your website's Cloudflare account so Slate can count AI bot visits, check that data is arriving, and fix a connection that stops working.

Bot Analytics counts AI bot visits from your website's Cloudflare logs. You connect Cloudflare once, from the Bot Analytics page. Slate then creates a log export in your Cloudflare account that sends bot requests only.

> [!NOTE]
>
> Bot Analytics is available to selected workspaces. Ask your Slate contact to turn it on for your workspace.

## Before You Start

* Your website runs through Cloudflare.
* You can create API tokens in that Cloudflare account.
* You have the **Admin** role in your Slate workspace. Other people see "Ask a workspace admin to connect Cloudflare."
* Logpush is turned on for the Cloudflare account. If it isn't, Slate tells you during the install. See [Troubleshooting](#troubleshooting).

## Step 1: Create an API Token

1. Open **Insights → AI Visibility**, then select **Bot Analytics** under **Website**.
2. Click **Connect Cloudflare**. The **Connect Cloudflare** dialog opens on **API token**.
3. Click **Open Cloudflare ↗**. Cloudflare opens the page for creating a token. Under **Zone Resources**, pick your site's zone.
4. Give the token these permissions on the zone:

| Permission | Access | What Slate uses it for |
| - | - | - |
| Zone | Read | Find your zone and its plan |
| Analytics | Read | Estimate requests a day |
| Logs | Edit | Send bot requests to Slate (Logpush) |
| Bot Management | Read | See if Cloudflare blocks AI bots |
| Zone WAF | Read | Name rules that block bots |
| Zone Settings | Read | Check Crawler Hints and other settings |

5. Create the token in Cloudflare and copy it. Cloudflare shows it only once.
6. Back in Slate, paste the token and click **Check**.

Slate checks each permission and marks it ✓ or ✕. **Zone** and **Logs** are required. The others are optional, but some checks on the page need them. Slate can't see your DNS records, billing, or other zones.

7. Click **Continue**.

## Step 2: Choose the Zone and Hostnames

1. Under **Zone**, choose your site's zone.
2. Under **Hostnames to count**, select the hostnames whose bot visits Slate should count. Each shows its traffic a day over the last 7 days. Slate preselects your main domain and its `www.` version when they have traffic.
3. Click **Install**.

You can choose up to 10 hostnames, all in the same zone.

You don't need to add a DNS record to prove you own the site. Managing the zone in Cloudflare is enough.

## Step 3: Install

Slate shows each step as it finishes:

1. **Logpush job created**: a job in your Cloudflare account that sends bot requests only, and skips static files such as images and scripts.
2. **Cloudflare reached Slate**: Cloudflare sent its check file to Slate.
3. **Last 30 days imported**: Slate brings in daily totals for the 30 days before you connected.

The install usually takes under a minute. You can close the dialog while it runs. When it's done, click **Go to Bot Analytics**.

> [!WARNING]
>
> **Undo install** removes the Logpush job and deletes the bot data Slate has collected for the site. Slate doesn't ask you to confirm.

## Check That Data Is Arriving

The status next to the page title shows the connection:

| Status | What it means |
| - | - |
| **Installing** | Slate is waiting for the first request to come through Cloudflare's logs. |
| **Healthy** | Requests are arriving, for example **Cloudflare · 5 min ago**. |
| **Delayed** | Slate's check request hasn't come through yet. Cloudflare sometimes sends logs late. |
| **No data** | Slate's check request didn't come through Cloudflare's logs. |
| **Token stopped working** | Cloudflare refused Slate's token. It was deleted or lost a permission. |
| **Job turned off** | The Logpush job was deleted or turned off in Cloudflare. |

Click the status to see details: the hostnames, the last delivery, and the bot requests in the last 24 hours.

While the 30-day import runs, a banner says **Importing your last 30 days from Cloudflare**. Live bot visits are counted already. If the import fails, admins can click **Retry importing**.

### About the imported days

The imported days are daily totals from Cloudflare Analytics. They're approximate, and Slate can't check them against each company's IP addresses. From the moment you connect, Slate checks every request. The chart marks where live data starts.

## Troubleshooting

**Cloudflare doesn't recognise this token.** Cloudflare shows a token only once. Create a new token and paste it.

**This token can't see any zone.** In Cloudflare, add your site's zone under **Zone Resources** for the token.

**The token can't send logs.** In Cloudflare, edit the token, add **Zone › Logs › Edit**, then click **Check again**.

**Logpush isn't turned on for this Cloudflare account**. In Cloudflare, open the zone, then **Analytics & Logs › Logpush**, and turn it on. Then click **Try again**.

**Cloudflare wants billing turned on**. Logpush on this account needs a payment method first. Add one in Cloudflare, then try again.

**Cloudflare refused a change**. Check that the token has **Logs › Edit** on this zone, then try again.

The status shows **No data**. Most often, the site's DNS record in Cloudflare was switched to DNS only (grey cloud), so requests no longer pass through Cloudflare. Turn the proxy back on for the record.

## Your Website in Settings

Connecting Cloudflare also adds your website to **Settings → Website**, marked as yours. Admins find it in **Workspace settings** under **Growth**.

## Website Tracking

Some workspaces also have **Website tracking** in **Workspace settings**, under **Growth**. It is a separate tracker: a script you add to your site's pages. Bot Analytics doesn't use it. Bot Analytics counts only the visits Cloudflare sends.

To add the script:

1. In **Website tracking**, click **Add domain**. Enter a domain like `example.com` and click **Add domain**. Add each subdomain separately.
2. Copy the snippet in **Install tracking on** your domain, and add it to every page of the site, just before `</head>`.
3. Publish your site, then click **Check now**.

**Check now** loads your home page once and looks for the snippet in its HTML. It finds the snippet only when it's in the page's HTML, so a script added through a tag manager shows as not found. Slate doesn't save the result.

To stop tracking a domain, open its **⋯** menu and click **Remove domain**. Remove the snippet from your site too.

## What's Next

* [Bot Analytics](https://slatehq.com/docs/bot-analytics/overview.md): read the visits, pages, and errors
* [Pages](https://slatehq.com/docs/pages/overview.md): the page list New pages uses


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