Note that there are some explanatory texts on larger screens.

plurals
  1. POBetter way to count total page views?
    text
    copied!<p>I am developing an eCommerce website which contains around 2000-3000 products(no.can be increase in near future).So i need to count total page views for a particular product.</p> <p>i know it can be simply done by just updating a mysql table on each page load but it's not the right way to do this because some one just press the reload button again again and the page views goes up.</p> <p>So i want to do it in a better way so total views no. somewhat closer to the unique/real one. </p> <p>i just came up with an idea that i can do it in 3 ways:\</p> <p><strong>1.Using cookies</strong> so if i just store cookie for each product then check against it for next unique visit then it can be done but i think it's not the better way to do this because if no of total cookies grows up then it will effect my page performance on each page request.</p> <p><strong>2.Using session</strong> i can use session to store data about each product and the visitor identity so i can track that is it a unique visit or a repeating one.But i think session data size also increase if a user visit more &amp; more products with same session. So is it good to use session for this purpose?</p> <p><strong>3.Use databse</strong> i can make a table <code>page_views</code> then update the count data by checking a time delay between the last visit and by matching the IP address and session id.</p> <p>so please suggest me that which method is better to use and the best way to implement that method.</p> <p>I am using <strong>PHP(Codeigniter 2.0.1)+Mysql</strong></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload