Calculating the most popular pages from the last month

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hame22
Forum Contributor
Posts: 214
Joined: Wed May 11, 2005 5:50 am

Calculating the most popular pages from the last month

Post by hame22 »

Hi

I am trying to create a list of the 10 most visited pages on my website in the last 30 days.

Does anyone have any expertise in setting up such as feature?

As I see it there are 2 potential options - 1. set up a database table to record page impressions or 2. access the website log files.

Log files seem the best option but I have no experience in doing this, does anybody have any suggestions on how I could achieve this?

Thanks in advance
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

In my opinion, setting up a database table and recording page impressions would be the best rout. Just update/insert a record on page view, query to get the most popular 10.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

How often do you want the list updated? If you want any sort of immediacy you'll have to go the DB route.

If you're happy with periodic updates you could parse log files on a cron job - or better yet scrape the output of a reporting package like AWstats (again, on a cron job).
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Use Google Analytics. Saves so many headaches. Nothing can touch it. Implement it on all your sites, now!!!
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

is there an API for GA?
User avatar
arjan.top
Forum Contributor
Posts: 305
Joined: Sun Oct 14, 2007 4:36 am
Location: Hoče, Slovenia

Post by arjan.top »

yes, check google api page :arrow: http://code.google.com/apis/analytics/
Post Reply