Cloudflare Ray ID enables unique click tracking in free redirects without Workers
Developers can attach a unique per-click identifier to Cloudflare redirect URLs on the free plan by using the cf.ray_id field in a dynamic Single Redirect rule, requiring no Worker or custom code. The approach was tested on July 30, 2026, and confirmed to produce a distinct ID for every request, with each ID matching the CF-RAY response header exactly. This allows destination analytics logs to be joined directly against Cloudflare's own dashboard logs. However, the method has a notable limitation: the preserve_query_string option replaces the target URL's query string rather than merging it, causing the click_id to be lost when incoming query parameters are present. A manual workaround is needed to append both the ray ID and incoming campaign parameters simultaneously.
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