Cloudflare Workers provide a powerful way to track AI bot visits at the edge, giving you real-time insights into how AI models interact with your website.
Cloudflare Workers offer several advantages:
Before setting up Cloudflare Workers, you need:
example.com/*)The Worker detects AI bots using multiple methods:
The Worker checks user agent strings for known AI bots:
The Worker also checks referer headers to identify traffic from AI chat interfaces:
After setup, visit Traffic in Ranketta to see:
If the Worker isn't tracking:
If data isn't appearing:
If you notice performance issues:
You can modify the Worker code to:
You can add multiple routes:
Use Cloudflare environment variables for:
After setting up Cloudflare Workers: