Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7711981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:30:50+00:00 2026-06-01T01:30:50+00:00

I am developing an eCommerce website which contains around 2000-3000 products(no.can be increase in

  • 0

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.

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.

So i want to do it in a better way so total views no. somewhat closer to the unique/real one.

i just came up with an idea that i can do it in 3 ways:\

1.Using cookies 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.

2.Using session 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 & more products with same session.
So is it good to use session for this purpose?

3.Use databse i can make a table page_views then update the count data by checking a time delay between the last visit and by matching the IP address and session id.

so please suggest me that which method is better to use and the best way to implement that method.

I am using PHP(Codeigniter 2.0.1)+Mysql

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T01:30:52+00:00Added an answer on June 1, 2026 at 1:30 am

    I would suggest you to create a new table to store session ID variable, along with an expire time of let’s say 2 hours. You can create a cookie with this ID on the client server, so that you don’t have to use MySQL queries repeatedly.

    In my intranet, I have only created a last_visitor_ip column in my web-hits table, and I am storing the last IP there, so that continuous refreshes are not counted. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a Ecommerce website by using version Magento 1.6. I need to
I am currently developing a ecommerce site which ofcourse contains images for each product.
I am developing an ecommerce website with CI that has product categories and products.
I'm developing an ecommerce search engine that allows you to search for products in
We're developing a new eCommerce website and are using NHibernate for the first time.
I'm developing an e-commerce community website, and i'm not sure which cms to use.
I am currently developing a little ecommerce application to help me get to grips
Developing a .NET WinForms application: how can I check if the window is in
Developing a website and just trying to get back into the swing of (clever)
Developing a project of mine I realize I have a need for some level

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.