seawolf
seawolf

Reputation: 2195

Drupal 7: Page Hit Counter for Dynamic Pages (not nodes)

The Drupal 7 Statistics module is able to track and display total hits (views) per node. However, this only works on static nodes such as /node/123 or /2014/some-node-title. I need to also display a hit counter on the homepage () and on pages that are defined in views rather than as nodes. I cannot find a module that does this. I have tried the following modules so far:

  1. Statistics (in core): see above
  2. Visitors: shows user and session data, not page hits
  3. Node View Count: only works for nodes, just like Statistics
  4. Counter: appears to only show user and session data, not page hits

Does anyone know of a module that can accomplish this? If Statistics can do it, how do I make the block appear on dynamic pages such as ?

Upvotes: 0

Views: 1654

Answers (1)

drnugent
drnugent

Reputation: 1545

@Anil Sagar has an example of using statistics to do this with views (see https://drupal.stackexchange.com/questions/48148/how-to-get-visitors-count-of-a-page-created-using-views,) but your question is a bit more broad in terms of all pages as opposed to just views.

Personally, I don't like to rely on the statistics module since I want to cache the page as heavily as possible without bootstrapping Drupal. If you are using Google Analytics, I would recommend the Google Analytics Counter module, which I think matches your requirements.

Good luck!

Upvotes: 1

Related Questions