javascriptphpcpanelhtmlvisitor-statistic

Determine how many times webpage has been accessed


I was wondering if there is a way to determine how many times a specific webpage has been accessed on the server. If possible, I would like to do this via cPanel, since the website is made in Wordpress, but the page in question I made from scratch and just uploaded it in another directory. So, I can't rely on plugins (right?) and I don't know enough PHP or JavaScript to communicate with web server and store that info on it...


Solution

  • Your server is already doing that, it is called the log file. If you grep it for the given page and count the number of log enteries, you will have the number of vistors who viewed that page. This, however, is inefficient and doesn't "work with CPanel".

    Next, you could write a simple script to insert an entry to a database every time someone visits that page. Then your answer could be queried by custom PHP you add to CPanel. This is more effiecient, but would be reinventing the wheel.

    But, the real answer is get analytics software. There are a number of products that can do this for you: