Need help tracking page views

Discussion in 'HTML & Website Design' started by jfarmer, May 22, 2007.

  1. #1
    I want to show on my main page how often my top articles are viewed, is there a script for this? I am fairly new at this and I know how to display page views on a the actual page, but not on a different page, any helpw ould be appreciated.

    Thanks
     
    jfarmer, May 22, 2007 IP
  2. Gordaen

    Gordaen Peon

    Messages:
    277
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You'll probably want to use some server-side scripting and a database (e.g., PHP and MySQL). Do you have any familiarity with those?

    What do you mean by "I know how to display page views on a the actual page, but not on a different page?"
     
    Gordaen, May 22, 2007 IP
  3. tushardhoot1

    tushardhoot1 Active Member

    Messages:
    3,013
    Likes Received:
    96
    Best Answers:
    0
    Trophy Points:
    90
    #3
    I would like help on this too, if possible. I think he (and I) mean a script that you can put on each one of your pages and then make a section of your site called "Top Game/Articles" and the top 5 or 10 will show up in list format.

    Is this possible?
     
    tushardhoot1, May 22, 2007 IP
  4. DW1

    DW1 Peon

    Messages:
    111
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    This is possible but to make it reliable is a bit tricky. You have to consider that because a user can view an article more than once you probably want to restrict recorded views based on IP, cookie, etc.

    Basically you would need a MySQL database table with fields for the article ID, user IP, number of views and a YMD date.

    You would then embed a small bit of PHP code to all article pages to check the database for a previous view for that day, article and IP. If it's found, ignore the visit. If not, increment the count with a simple MySQL query.

    Still more custom code would be needed to pull the top 5 or 10 from the database and display it on your web page.

    Easy for a programmer. Not so easy for those with little PHP+MySQL experience. If you have a WordPress blog there are plugins available that make this a snap with no programming required.

    Regards
     
    DW1, May 22, 2007 IP
  5. jfarmer

    jfarmer Well-Known Member

    Messages:
    542
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    140
    #5
    No I only know enough about PHP and MYSQL to be dangerous. I was hoping I could modify an existing script.

    It would be nice to have a top ten most viewed articles and then the stats though, maybe I will look at scriptlance.
     
    jfarmer, May 22, 2007 IP