- b2evolution CMS User Manual
- Back-office Reference
- Analytics
- Settings
- Post Views Counting
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 trade-off is that it tracks only 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 hit log 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 doesn’t try to deduplicate.
For versions prior to b2evolution v5.1:
Here is how b2evolution counts views on posts when "smart view counting" is turned on:
-
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 hit log 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").
-
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 hit log and session tables to detect page reloads from the same user session and ignores them.