Pages

Friday, February 28, 2014

Track Hits and Show the Most Popular Drupal Content

Nearly every news and magazine site shows a list of the most popular content.
Drupal can track the popularity of content using only the core features.
Here's how to track the hits on your Drupal content and how to show those statistics.

Step 1. Enabling Statistics

  • Go the the Modules screen and enable the Statistics module.
media_1379702042672.png
  • Go to Configuration > Statistics.
  • Check the box for Enable access log.
  • Check the box for Count content views.
media_1379702359500.png

Step 2. Viewing the Statistics

Go to Reports > Recent hits and you'll be able to see a record of which pages have been visited. If the user is logged in, you can also track their username.
media_1379702577334.png

Step 3. Using the Statistics

Once the statistics module has been turned on, it wil then be available in Views.
For example, you can use statistics in the Sort criteria for views. This would allow you to show the most popular content.
media_1379702771732.png
You can also add statistics as a field, so you can see the number of hits on each article. This would be useful for display on some sites but also for internal reports created with Views.
media_1379702859576.png

No comments:

Post a Comment

Thanks for your comment.