Jump to content

Recommended Posts

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.

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??

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.