Add configurable "qualified view" counts for XenForo content

Stuart Wright

Well-known member
Licensed customer
XenForo's current view counts include requests from bots/crawlers and do not suppress repeated requests from the same visitor. This means view_count can be significantly higher than the number of genuine human page views.

It would be useful if XenForo had a common concept of a qualified view that could be applied to thread views and, where appropriate, other content view counters such as pages, resources, media and articles.

We've recently been looking at this in some detail on AVForums because we also maintain our own view counter for editorial content.

Our editorial view counter works differently from XenForo's thread counter:
  • Known bots/crawlers are excluded based on the user agent.
  • Repeated requests for the same content are suppressed within a 30-second window.
  • For logged-in users this is based on user ID/content ID/timestamp, while guests use a hash of the IP address.
  • Once the 30-second period has elapsed, a subsequent visit can count as another view.
This has produced an interesting difference when comparing the native counters with Google Analytics.

For one recent review and its associated discussion thread, over comparable periods, we found:
  • Editorial review: native counter 2,191 views versus 2,395 GA4 views.
  • Discussion thread: XenForo counter 3,301 views versus approximately 2,390 GA4 views.
Obviously GA4 should not be regarded as a definitive measure of actual readership either. In particular, GA will not account for all visitors, including those for whom Analytics measurement is prevented by consent choices or other browser/privacy mechanisms. Nevertheless, the contrast illustrates how substantially different counting methodologies can affect the resulting numbers.

A XenForo qualified view could:
  • Exclude requests identified as robots using XenForo's existing robot detection, with the possibility for add-ons to extend the robot definitions.
  • Suppress repeated views by the same visitor for a configurable period - for example, 30 seconds.
  • Identify logged-in visitors by user ID and guests using a suitable privacy-conscious identifier.
  • Exclude requests identified as browser prefetch/prerender requests where the content has not actually been viewed.
  • Allow genuine repeat visits after the configured suppression period to count again.
The existing view_count could remain unchanged for backwards compatibility and historical consistency, with the qualified count stored separately. Ideally, administrators could enable or disable qualified view counting and configure the repeat-view suppression period.

This would provide forum owners with a more meaningful measure of human readership, without attempting to turn the view counter into a full analytics system.

It should also make the figure more useful commercially. A qualified human view count would provide a better basis for estimating advertising opportunity and potential revenue than a raw view count that includes crawler traffic and repeated requests.

It would not, of course, represent actual ad impressions or revenue - factors such as consent, ad blocking, fill rate, viewability and the number of advertising placements still need to be considered - but it would provide a much more useful starting point for understanding the monetisable audience of XenForo content.
 
Upvote 2
We currently hide view counts across all of our sites because I don’t think this is data that should be visible to users or guests. The numbers can also be quite unreliable and therefore potentially misleading.

I would therefore suggest removing view counts entirely from the public-facing sites and keeping them only for internal calculations and analytics.

Admins already have access to reliable traffic data through Google Analytics or Matomo, so there is little benefit in exposing these figures publicly.
 
I think users absolutely need to know how many times their threads have been viewed. One important aspect of the community is the ownership that OPs feel of their threads. When they can see the number of times that their threads are viewed, if it’s a good number, they will feel good. If it’s a low number, they will not feel good. If the forum is busy, this may have the effect of encouraging them to post better threads, because it’s the quality of their thread title which largely influences engagement.
Also, if the forum is commercialised, it’s important to advertisers to see the amount of views that forums and threads get.
Showing view counts could be an option, but IMO they should absolutely be visible.
My suggestion here is to make the view count more a representation of actual thread page human reads.
So your reply is somewhat off topic.
 
Back
Top Bottom