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 3281520
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:49:29+00:00 2026-05-17T19:49:29+00:00

What is the best way to track page views? For instance: SO has how

  • 0

What is the best way to track page views? For instance: SO has how many views a Question has, yet hitting refresh doesn’t up the view count.

I’ve read that using cookies is a pretty good way to do so, but I’m at a loss on how this doesn’t get out of hand.

I’ve searched all over and can’t find a good answer for this.

EDIT:

I also see that another option (once again I could be horribly wrong) is to use Google Analytics API to get page views. Is this even an viable option? How does Stackoverflow, youtube, and others track their views?

  • 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-05-17T19:49:30+00:00Added an answer on May 17, 2026 at 7:49 pm

    You can track them in a database if you’re rolling your own. Every time a page loads, you call a method that will decide whether or not to up the page views. You can add whatever criteria you like.

    IF IP is unique
    OR IP hasn’t visited in 20 minutes based on a session variable
    ETC
    THEN add a page view record

    | ID | IPAddress | ViewDateTime |
    | 1  | 1.2.3.4   | Oct 18 ...   |
    

    However, session variables can get pretty load intensive on sites with as many visitors as SO. You might have to get a little more creative.

    Now, if you don’t want to code it, the I would suggest looking into SmarterStats as it reads your server logs and is more robust than analytics.

    note: i’m not sure about a similar Apache software

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

Sidebar

Related Questions

What's the best way to authenticate and track user authentication state from page to
What is the best way to track changes in a database table? Imagine you
What is the best way to track down a memory leak that is only
In PHP, what's the best way to track an objects state, to tell whether
What is the best way to authorize all users to one single page in
What's the best way to visually highlight each word on the page, one at
What is the ideal way to keep track of the total count of items
What is the best way to verify/test that a text string is serialized to
What is the best way of creating an alphabetically sorted list in Python?
What is the best way to store international addresses in a database? Answer in

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.