Developer tracks which pages AI crawlers read using a Cloudflare Worker and D1
A web developer describes how analytics miss whether ChatGPT and other AI crawlers read a page, since those bots do not run JavaScript. Running on Cloudflare Workers, they added about a hundred lines of code that count crawler requests per day, page, bot and status in a D1 database, storing no IP addresses, user agents or personal data. Only crawlers whose vendors document their user-agent tokens are counted, and the developer notes that user agents can be faked, so the numbers reflect claimed identity. Within a day the tracking revealed that newly published pages linked only from the sitemap had not been fetched by OpenAI's search crawler or Bingbot, prompting the developer to link them from the home page and related guides. The write happens after each response and adds one database write per crawler page view.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in