2

I wonder if someone can point me in the right direction for the following:

I'd like to collect and display statistics for a Views page.

I wonder what's the best approach for collecting basic 'hit' statistics for a views page (essentially a visitor counter for that view). The view uses contextual filtering (i.e. nid) to render content. Ideally, each path (i.e. viewpath/12, where 12 is the nid) has separate statistics.

Any guidance is appreciated.

1

Have a look at the Visitors module. Here are some reports you get from it:

  • View pages that have recently been visited.
  • View pages that have been hit frequently.
  • View pages count per month, day of month, day of week, hour.
  • ...

Especially these reports should be what you're looking for (it includes hits for paths corresponding to a view):

  • Top pages (table with columns Title, Path and nr of Hits).
  • Recent hits (table with columns Date of visit, Title, Path and User ID of the visitor).

Checkout the above (source) links to get an idea of which data are available.

Extra reporting features can be enabled via these sub-modules:

  • The Visitors GeoIP module, to also report about countries and cities.
  • The Visitors Browscap module, providing statistics on visiting browsers.

The demo site contains some sample reports (charts) available to anonymous users also. This demo site also shows some additional blocks with reports also created by the Visitors module module.

You may also want to look at the visitors_schema to get an idea of the data that actually get logged (recorded) by this module.

In case it's not a perfect fit, it's probably a very good starting point for some custom reporting. Either via a custom module that would simply have to query the data maintained by the Visitors module. Or via a straight forward custom report created with the Forena module.

Disclosure: I'm the maintainer of the Visitors module,
and co-maintainer of the Forena module.

  • Thanks Pierre, I was unaware of the Visitors module - it looks really promising and should cover my requirements. I'll give it a shot soon and report back. – ymdahi Apr 4 '16 at 14:35
  • 1
    @ymdahi Merci for the (late) accept! – Pierre.Vriens Oct 26 '17 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.