Cloudflare
Count AI bot visits from Cloudflare's HTTP request analytics with a read-only API token. Works on every Cloudflare plan.
Sommet reads the request counts of your zone from Cloudflare’s GraphQL Analytics API. It only asks for requests whose user agent matches an AI bot. It needs no Worker, no Logpush job and no change to your site. It works on the Free plan.
Connect
Copy the zone ID
In the Cloudflare dashboard, open your domain. On the Overview page, find the API section at the bottom of the right column and copy the Zone ID. It has 32 characters.
Create a read-only API token
Open My Profile → API Tokens → Create Token and choose Create Custom Token.
- Token name:
Sommet analytics - Permissions:
Zone·Analytics·Read - Zone resources:
Include·Specific zone· your domain
Select Continue to summary, then Create Token, and copy the token. Cloudflare shows it only once.
You can also start from Cloudflare’s Zone Analytics token template. Limit it to your zone before you create it.
Paste both in Sommet
Open Settings → AI bot visits, choose Cloudflare, paste the zone ID and the token, then select Connect Cloudflare.
Sommet runs one real analytics query before it saves the token. If the query fails, the error from Cloudflare shows under the form.
How the sync works
- Sommet checks for new data every 15 minutes and counts each full hour once.
- It waits 10 minutes after the end of an hour, because Cloudflare analytics arrive with a short delay.
- The first sync counts the last 24 hours.
- If the token stops working for more than 24 hours, the hours in between are skipped, not estimated.
Troubleshooting
| Message | What to do |
|---|---|
| Cloudflare rejected this API token | The token is wrong, expired or revoked. Create a new one. |
| Zone not found for this token | The zone ID is wrong, or the token does not include this zone. |
| The last sync failed | Open Change source, read the error and paste a new token if needed. |
The token is encrypted at rest. Disconnecting the source deletes it. You can also revoke it in Cloudflare at any time.