2

I need to do a lot of sort criteria based on the number of profile pages viewed in Views , but I do not have any fields related to statistics and I cannot find any module which would help me to add fields to Views displays. Is there any module that would do the job or what do I have to do to get statistics about certain pages?

Someone said to alter the view query but how do I know in which table and what reference is between that table and the page that I want the statistics for?

  • drupal version? – AjitS Dec 18 '12 at 10:12
  • @indrock drupal 7 – Vlasin Dec 18 '12 at 10:26
2

For this you have to enable the Statistics module which is provided by Drupal Core. Follow these steps : 1. First enable Statistics Module 2. Then make a view and add a field provided by Statistics module. It basically provides three options:

Most recent view
Total Views
Views today 

and then use Total Views as mentioned in your requirement.

1

1. Module Visitors

Have a look at the Visitors module. It comes with a set of Visitors Reports, such as:

  • User activity report (hits, nodes, comments).
  • A Visitor tab that is added to each node, with details about Referrer, Date, User, IP address, User agent.

This module comes with its own set of (fixed) reports, whereas these reports are about data stored in the tables this module maintains.

If the reports they come with don't meet all your reporting requirements, you could use something like the Forena module to create custom reports (and charts) about the data stored in any of these tables. Another option is to create a custom module (with custom queries) for this kind of reporting.

2. Module Forena

If you'd want to "roll your own cookies" (i.e. some report that perfectly fits your custom requirements), then you might want to consider the Views integration of the Forena module. Here is a relevant excerpt about that from its project page:

Use Views with Forena to create additional more complicated layouts than can typically be created using views. Forena provides a views rowstyle plugin that lets you use a Forena report to format the output of a view.

For an example of such custom report, created with Forena, start from the statistics (summary info) of the Watchdog Statistics, as in this Watchdog Statistics sample. Note the red numbers to the right of the table, which are actually hyperlinks that can be used as drill-down reports. I.e. if you click on any of them (like the "2" for "Page not found"), you get a details report about (in this case) the 2 specific records related to the "Page not found"). More details about this specific case can be found in comment #2 of issue 2337327.

Disclosure: I'm maintainer of the Visitors module, and co-maintainer of Forena,
I hope this does not violate the site's policy on self-promotion.

0

There is also the Better Statistics Module that will further expand the core Statistics module by letting you omit paths/roles/lots of other customizations. Then all of this info is available on the node level in views.

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.