Implementing Analytics Before Cloudflare Redirect Rule Activation: Seeking Solutions

Hello. I’m facing a challenge with tracking traffic on my site that employs a Cloudflare Redirect rule to reroute certain users to another site. The issue is that the Redirect rule executes too swiftly, preventing analytics servers from capturing visitor data before the redirection occurs. Is there a method to configure analytics to track traffic before the Redirect rule is triggered? I would greatly appreciate any suggestions or guidance on how to resolve this issue.

It’s the way a 3XX redirect works, it simply says “go here” when you request the link and doesn’t load any page content.

To do what you want, you can have a page that loads on the request and contains your tracker, and then uses javascript to do the redirect when the tracker is finished or the meta refresh HTML tag to redirect after a time. (Someone else may have a better solution).

1 Like