Suggestion: secret token to prevent request from being included in analytics

#1

I have a few scripts running on my origin server and some of them ping or send other kinds of requests to my Cloudflare domain. What I would love to see is some kind of secret token that, when included in the request header for example, lets Cloudflare know that this request shouldn’t be included in the analytics.
This would allow for more precise estimation.

Let’s take my web traffic requests by country for example:
I’m getting about 1500 requests in 24 hours from Germany (the location of my origin server). The thing is that most of these are probably pings and fetches from my own scripts that I don’t want to be included in the analytics.

Another solution would be to just ignore all requests from the origin server’s IP address (if turned on in the settings) but the above solution would allow for more customization.

A third option would be to just implement a firewall rule called “ignored in analytics” or something like that.

#2

I understand the reason behind your feature request, but that approach should generally be avoided. Never call your site from your own site. Whatever you have to do, do it locally and do not go the HTTP route.

#3

Yeah, I know I shouldn’t do that but for what I want to achieve I really don’t see a better way.
Also that’s a bit besides the point. Let’s say someone wants two separate servers with two separate domains to communicate with each other.

#4

Can you elaborate? This is generally not a topic for the forum here, but maybe we can find a solution quickly nonetheless.

Well, not really :wink:

If it is two servers you’ll have to go through some sort of RPC but in that case you should go straight for the IP address and not through Cloudflare. The latter simply calls for troubles.

#5

I’ll be honest, I’m guilty of this. Every 10 seconds about 6 request are fired to my origin and that does skew the analytics. Thankfully my numbers are consistent so I can just subtract (number of times 10 seconds passes in a day * 6) from the analytics and I have a rough estimation.

But this isn’t good practice for analytics purposes. Most websites don’t have this issue so I doubt CF will work on such a niche feature.

At this point, you should invest in a separate logging solution (maybe even based on CF workers, something similar to https://logflare.app) and use that for analytics.