Can I detect users who load and/or don't load a specific file type (Ex: *.php or adsbygoogle.js)

I want to use firewall page rules (or tools or something else) to track users based on the number of visits to pages with a .PHP (or other types of) extension within certain folders. If this is possible, can someone explain how? I can’t figure it out in the firewall rules or tools.

I also want to detect users who don’t load adsbygoogle.js. I can’t figure out an expression that makes this work. By doing this, I will accomplish two things:

  • Filter out bots who typically skip the adsbygoogle.js
  • Be able to give users who block ads a message that ads are required.

I think these would all be useful features to add to Cloudflare if they don’t already exist.

Assume that you are using either Free, Pro or Business plan, you won’t have access to the Firewall “Log” action. However, you can use a “trick” to log the traffic by using the “Allow” action, though you must move the firewall rule to the very bottom in order for this to work.

This must be done via client-side JavaScript. There are few tutorials available on the Internet where you can implement this check.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.