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

Related Questions

I have a public facing web page in .Net that I would like to
I have a web service that is externally facing but I would like it
I have a REST web service using spring MVC which is external-facing. I would
I have a WEB Application deployed in Tomcat. I would like to intercept all
Ok, so we have clients and those clients get to customize their web facing
I have created a web user control called Activity. I have defined a public-facing
I have some internal-facing ASP.NET web services that have had numerous API additions over
Assume you have a customer-facing application hosted on a Web server. You have no
We have a massive client facing web application here. We recently re-wrote the buy
I have a web service that looks like this: public class TheService : System.Web.Services.WebService

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.