I want to show the number of viewer for a particular Article. How i will do it in my program? Any strategy, someone can suggest ...
A:
If you aren't using any framework or CMS, then you can integrate either Google Analytics or Piwik into your website. Then use their inner data to display number of views/unique views per article.
- Make a table with article id/url (or whatever you technique is), IP, user agent.
- In every relevant page have each page access write down these values.
- To display number of views simply select count
- To display number of unique views display count(distinct)
Am
2010-02-01 12:12:56
What things i will consider?Whether to increase the number of person viewed this question every time the page loads?then what will happen if somebody refreshes the page again and again?
Devi
2010-02-01 12:18:24
this is why using piwik or google is better. they have both options. it depends on what do you want, if it's how many different people viewed it, then unique views is the answer.
Am
2010-02-01 12:20:19
I am not using any CMS and i don't want to integrate any such things.Any other suggestion which will satisfy both or will lie in between it?
Devi
2010-02-01 12:23:46