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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:56:41+00:00 2026-05-11T02:56:41+00:00

I have a web facing, anonymously accessible, blog directory and blogs and I would

  • 0

I have a web facing, anonymously accessible, blog directory and blogs and I would like to track the number of views each of the blog posts receives.

I want to keep this as simple as possible, accuracy need only be an approximation. This is not for analytics (we have Google for that) and I dont want to do any log analysis to pull out the stats as running background tasks in this environment is tricky and I want the numbers to be as fresh as possible.

My current solution is as follows:

  1. A web control that simply records a view in a table for each GET.
  2. Excludes a list of known web crawlers using a regex and UserAgent string
  3. Provides for the exclusion of certain IP Addresses (known spammers)
  4. Provides for locking down some posts (when the spammers come for it)

This actually seems to do a pretty good job, but a couple of things annoy me. The spammers still hit some posts, thereby skewing the Views. I still have to manually monitor the views an update my list of ‘bad’ IP addresses.

Does anyone have some better suggestions for me? Anyone know how the views on StackOverflow questions are tracked?

  • 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. 2026-05-11T02:56:41+00:00Added an answer on May 11, 2026 at 2:56 am

    It sounds like your current solution is actually quite good.

    We implemented one where the server code which delivered the view content also updated a database table which stored the URL (actually a special ID code for the URL since the URL could change over time) and the view count.

    This was actually for a system with user-written posts that others could comment on but it applies equally to the situation where you’re the only user creating the posts (if I understand your description correctly).

    We had to do the following to minimise (not eliminate, unfortunately) skew.

    • For logged-in users, each user could only add one view point to a post. EVER. NO exceptions.
    • For anonymous users, each IP address could only add one view point to a post each month. This was slightly less reliable as IP addresses could be ‘shared’ (NAT and so on) from our point of view. The reason we relaxed the ‘EVER’ requirement above was for this sharing reason.
    • The posts themselves were limited to having one view point added per time period (the period started low (say, 10 seconds) and gradually increased (to, say, 5 minutes) so new posts were allowed to accrue views faster, due to their novelty). This took care of most spam-bots, since we found that they tend to attack long after the post has been created.
    • Removal of a spam comment on a post, or a failed attempt to bypass CAPTCHA (see below), automatically added that IP to the blacklist and reduced the view count for that post.
    • If a blacklisted IP hadn’t tried to leave a comment in N days (configurable), it was removed from the blacklist. This rule, and the previous rule, minimised the manual intervention in maintaining the blacklist, we only had to monitor responses for spam content.
    • CAPTCHA. This solved a lot of our spam problems, especially since we didn’t just rely on OCR-type things (like ‘what’s this word -> ‘optionally’); we actually asked questions (like ‘what’s 2 multiplied by half of 8?’) that break the dumb character recognition bots. It won’t beat the hordes of cheap labour CAPTCHA breakers (unless their maths is really bad 🙂 but the improvements from no-CAPTCHA were impressive.
    • Logged-in users weren’t subject to CAPTCHA but spam got the account immediately deleted, IP blacklisted and their view subtracted from the post.
    • I’m ashamed to admit we didn’t actually discount the web crawlers (I hope the client isn’t reading this :-). To be honest, they’re probably only adding a minimal number of view points each month due to our IP address rule (unless they’re swarming us with multiple IP addresses).

    So basically, I’m suggested the following as possible improvements. You should, of course, always monitor how they go to see if they’re working or not.

    • CAPTCHA.
    • Automatic blacklist updates based on user behaviour.
    • Limiting view count increases from identical IP addresses.
    • Limiting view count increases to a certain rate.

    No scheme you choose will be perfect (e.g., our one month rule) but, as long as all posts are following the same rule set, you still get a good comparative value. As you said, accuracy need only be an approximation.

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

Sidebar

Ask A Question

Stats

  • Questions 62k
  • Answers 62k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer You want window.opener not window.parent (that's for frames). May 11, 2026 at 10:04 am
  • added an answer byte[] binaryData = Convert.FromBase64String(bgImage64); BitmapImage bi = new BitmapImage(); bi.BeginInit();… May 11, 2026 at 10:04 am
  • added an answer How about something like this? SELECT COUNT(incident_id) AS 'Calls', MAX(open_time),… May 11, 2026 at 10:04 am

Related Questions

I have a web facing, anonymously accessible, blog directory and blogs and I would
I have a web-service that I will be deploying to dev, staging and production.
I have a web service that I created in C# and a test harness
I have a web site in asp.net that uses a master page. In this
I have a web reference for our report server embedded in our application. The
I have a web service (ASMX) and in it, a web method that does
I have a web service that queries data from this json file, but I
I have a web application that should behave differently for internal users than external
I have a web system which has a classical parent-children menu saved in a
I have a web report that uses a Django form (new forms) for fields

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.