Skip to Content
IntegrationsCloudflare

Cloudflare

Lua reads AI crawler visits (GPTBot, ClaudeBot, PerplexityBot and others) from Cloudflare’s traffic analytics for your site, once a day, and shows them in Agent Analytics.

Before you start

Your site’s visits must pass through Cloudflare. In the Cloudflare dashboard, open your site, go to DNS > Records, and check that the record for your domain shows an orange cloud (Proxied). A grey cloud (DNS only) sends visitors straight to your host, and Cloudflare then has nothing to report. If your site is hosted on Vercel and you want to keep the grey cloud, use the Vercel connection instead.

Cloudflare can also block AI crawlers for you. In Security > Bots (or AI Crawl Control), check that Block AI bots is off, or the crawlers never reach your site and there is nothing to count.

1. Create an API token

  1. In Cloudflare, open My Profile > API Tokens and click Create Token.
  2. Under Create Custom Token, click Get started.
  3. Add two permissions:
    • Zone > Analytics > Read
    • Zone > Zone > Read
  4. Under Zone Resources, choose Include > Specific zone and pick your site.
  5. Click Continue to summary, then Create Token, and copy the token.

2. Connect it in Lua

  1. In Lua, open Integrations and click Set up on the Cloudflare card.
  2. Paste the token and click Connect Cloudflare.

Lua finds the site from the token. If the token covers several sites, pick the one to connect.

Crawler visits appear in Agent Analytics after the next daily sync.

Troubleshooting

“This token cannot list your sites.” The token is missing Zone > Zone > Read. Add it, or paste the Zone ID instead: it is on the site’s Overview page in Cloudflare, in the API box on the right.

“This token cannot read analytics for that site.” Add Zone > Analytics > Read for that site.

Connected, but no visits. Lua warns you when your site’s visits skip Cloudflare. Switch the DNS record to Proxied, or connect Vercel.

Last updated on