johnsmith153 Posted August 7, 2009 Share Posted August 7, 2009 What is the best way to track page views in a forum? (1) Every page view to add a record to a db table then search every time user views post (could have millions of records in the "page views" table) (2) Every page view to UPDATE the topic record (first search and return current page views and then add 1) (3) number (1) above, but use a CRON job to organise things better behind the scenes (e.g. CRON sorts data and UPDATES the topic record. (4) Something else. I am not bothered about if you should track every page view / track unique IP etc. just how would be best to do the database side of things. Quote Link to comment https://forums.phpfreaks.com/topic/169228-what-is-the-best-way-to-track-page-views-in-a-forum/ Share on other sites More sharing options...
watsmyname Posted August 7, 2009 Share Posted August 7, 2009 What is the best way to track page views in a forum? (1) Every page view to add a record to a db table then search every time user views post (could have millions of records in the "page views" table) (2) Every page view to UPDATE the topic record (first search and return current page views and then add 1) (3) number (1) above, but use a CRON job to organise things better behind the scenes (e.g. CRON sorts data and UPDATES the topic record. (4) Something else. I am not bothered about if you should track every page view / track unique IP etc. just how would be best to do the database side of things. Do you just want a view count for particular topics?? Quote Link to comment https://forums.phpfreaks.com/topic/169228-what-is-the-best-way-to-track-page-views-in-a-forum/#findComment-892938 Share on other sites More sharing options...
mikesta707 Posted August 7, 2009 Share Posted August 7, 2009 I would do number 2 personally Quote Link to comment https://forums.phpfreaks.com/topic/169228-what-is-the-best-way-to-track-page-views-in-a-forum/#findComment-892939 Share on other sites More sharing options...
watsmyname Posted August 7, 2009 Share Posted August 7, 2009 I would do number 2 personally Bingo! me as well Quote Link to comment https://forums.phpfreaks.com/topic/169228-what-is-the-best-way-to-track-page-views-in-a-forum/#findComment-892951 Share on other sites More sharing options...
kickstart Posted August 7, 2009 Share Posted August 7, 2009 Hi Another vote for number 2, just watch out for adding 1 again when they go to the 2nd page of that topic. You might want to do 1 if you want to put up a flag showing what topics they haven't yet read. All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/169228-what-is-the-best-way-to-track-page-views-in-a-forum/#findComment-893033 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.