Post Views Counting
This feature has moved to an external plugin
A similar feature is now available in an external plugin that you might want to use if you really want this feature: View Count Plugin. (Note: this plugin is not part of the official b2evolution distribution).
Another possible alternative
In case you’re interested in tracking views from your registered users, b2evolution actually allows to track who viewed what and can display that information through a widget (Seen By Widget). This is a much more precise system as it really counts only one view per user. The tradeoff is that it tracks only for logged-in users (because non-logged in users are virtually impossible to identify accurately, let alone trying to filter out spam bots, see below…)
Why was general view counting removed from the core in b2evo 5.1+?
The goal of this feature was to count real views and not robot views or repeat views.
To do that, this feature required heavy access to the hitlog in order to deduplicate views, exclude robots, etc. This feature alone created a heavy load on SQL servers which in turn lead to many users having their web-hosting accounts suspended. On more popular sites running on dedicated servers, this feature was responsible for limiting the performance of these websites.
This kind of feature was just too heavy in terms of required processing power to make sense to maintain.
If you need a feature like this we recommend outsourcing the counting to a specialized analytics package like Google Analytics (free) which is heavily optimized for doing the counting without creating any load on your server.
You can also use the aforementioned plugin, which is a bit more optimized than the precious system, and which also doesnt try to de duplicate.
For versions prior to b2evolution 5.1:
WARNING: Enabling "smart view counting" may dramatically slow down your site if you have heavy traffic.
Here is how b2evolution counts views on posts when "smart view counting" is turned on:
1 If the user is anonymous, multiple reloads of a single page (URL) from a given IP will only be counted once every x seconds, depending on the "Reload-Page timeout" setting in Collections Timeouts. b2evolution checks the hitlog table to detect page reloads from the same IP and ignores same IP + same URL duplicates within a certain time frame (as defined by "Reload-Page timeout").
2 If the user is logged in, multiple reloads of a single page (URL) from a given user session will only be counted once per session. b2evolution joins the hitlog and session tables to detect page reloads from the same user session and ignores them.
Note: In earlier versions, b2evolution was counting one view per user, not one view per session. This was changed in version 4.1.
Note: In earlier versions, there was a bug preventing view counts when page caching was used. This was fixed in version 4.1 by adding a list of post_IDs to increment when displaying a page from the cache. The mechanism described in 1) still applies though.
Created by • Last edit by on Sep 06, 2016