Skip to content

Cloudflare Edge Analytics Worker Setup

Use the current Worker integration and matching secret bindings to measure requests on an existing website.

Published

Follow the current Cloudflare Worker guide for the complete script, RAILS_URL and SHARED_SECRET bindings, proxied website routes, and verification.

The Worker forwards the request to the origin and schedules analytics with ctx.waitUntil(). Background analytics is best effort; this is not a promise of zero latency or delivery for every request.

A Worker route must match the website hostname, and its DNS record must be proxied. A workers.dev URL alone does not observe your website traffic.

Keep secret names consistent with the script. The current integration uses SHARED_SECRET, not a mixture of LOG_SECRET and env.log_secret. Store the value as a Cloudflare Secret and keep it out of public source and screenshots.

Verify normal website responses and the first observed event using the linked guide. Request counts are distinct from human referrals and AI citations.

Built for the answer era

Build a website people can use & AI can understand.

Build and deploy with your coding agent, or add an AI companion to your existing website.