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.