by John

Drupal has its own core statistics module to track page hits, referrers, and visitors. While it serves basic needs, I have long been dissatisfied with this module and recently switched all of my sites over to the free Google Analytics service. The service is easily enabled on a Drupal site with a contributed module written by Mike Carter. Google Analytics regenerates reports every 24 hours, so if you need real-time statistics, you'll need to look elsewhere.

google_analytics_dashboard_0.png

The Google Analytics service is a much more powerful reporting engine and there really is no comparison with the statistics module (nor should there be). After using Google Analytics, you'll quickly wonder how you got along without site navigation reporting such as entry/exit points, tracking advanced campaign and conversion metrics, and a well thought-out dashboard. The site overlay click analysis is particularly cool (shown below).

google_analytics_overlay_0.png

My biggest complaint about the statistics module has always been that it is brain dead when it comes to log filtering. The Google Analytics module allows you to filter logging by role, and not record the browsing activities of Site Admins which can distort any useful picture of site activity. The module also comes pre-configured to not record any activity on /admin pages as well. Nice touch!

The statistics module is arguably more tightly integrated with Drupal (at the moment), so some features will be missing if you completely ditch statistics for Google Analytics. You will still need the statistics module for Top Content blocks, but can thankfully enable page access counters without recording the other access statistics. The filtering issue mentioned above still applies. In addition, if you might miss IP banning from the top visitor page, I would definitely recommend looking at a contributed module like Troll.

The Google Analytics module also integrates Drupal user profile information into the service, which I have not yet had time to play with. It could be even more useful if the service segmented based on user role. I will look to add that capability in the future. Some other things I'd like to see added to the Google Analytics module, and may tackle as time permits:

  • even more log filtering options: IP address, configurable exclude paths
  • top content block pulled from Google Analytics data: eliminate any remaining need for statistics module
  • Google Analytics dashboard integration within Drupal admin
  • adding internal search keywords to tracker code
  • adding Javascript onClick events to outbound and download links to tracker code

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Highlighted PHP code can be posted with <?php ... ?> tags.

More information about formatting options

Captcha
We're only human... Captcha is a simple challenge-response test to make sure you are too.
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.