Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+5 votes
969 views
in Q2A Core by
Now that you've added a view count to each question, how did you add views for older questions? Did you take data from server logs or analytics etc?
by
Also, obviously you're still in beta right now, but it might be worth making the view box smaller since it's less important and gonna have higher numbers. Currently it makes the question title quite narrow.
by
even I'm wondering how it is calculated.
by
Probabily each time one question page is requested, is adds one view to the database. One efficient way to do this is at least save the last visited question and don't count like a view if we're viewing the same question again. :)
by
They counted by IP adress, but i'm still curious how older questions has been counted. Maybe they already counted after this feature...
by
my question was, how it is calculated for old questions?

1 Answer

+3 votes
by
 
Best answer
I analyzed the server logs since the start of Q2A. BTW, the view counter inside Q2A is quite a bit smarter than server log analysis.
by
OK fair enough, I guess that won't be an option for everyone. I might see if I can get data from Google Analytics...

I can see you are tracking IP or user accounts since the counter doesn't keep going up every time I load a question. Are you counting only logged-in users? What about search engine robots etc?
by
Bots are excluded (the browser user agent has to contain one of a number of fixed strings), the question author is excluded (apart from the first view), and sequential requests from the same IP address are excluded. But views from the same IP address are counted if a different IP address views the question inbetween. This does leave open a window for determined abusers, but on the other hand, I don't think it makes sense to add a database row for every view on a questoin.
...