General plugins (Local) ::: local_analytics
Maintained by Bas Brands
A local Moodle Module adding Analytics. This plugin currently supports 3 Analytics modes, Piwik, Google Universal Analytics and Google Legacy Analytics.
Latest release:
1509 sites
114 fans
Current versions available: 5


A local Moodle Module adding Site Analytics

The plugin features the following options:
- exclude tracking of admin users
- build full navigation tree for Piwik course category and activity tracking
- image based tracking in case javascript is disabled (for Piwik)
- advanced analytics for Google analytics (based on Bas Brands and Gavin Henricks work in 2013)

The plugin currently supports 3 Analytics modes, Piwik, Google Universal Analytics and Google Legacy Analytics.

For installation instruction on Piwik, please visit


Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3


Bas Brands (Lead maintainer)
David Bezemer: Original author
Please login to view contributors details and/or to contact them

Comments RSS


  • MD shot of me from his iphone4
    Fri, Dec 20, 2013, 2:30 PM
    Thanks for sharing this.

    Would it be better if and this were combined and we could select analytics providers?
  • David
    Fri, Dec 20, 2013, 7:43 PM
    Hi Aparup,
    that is something I am working on currently, adding support for both Google Universal Analytics and Google Analytics (old style)
  • Tue, Jan 21, 2014, 6:36 PM
    Hey, I think there is a litte problem, in my case piwik do not work. I get only some visits and not all, do you know wether there is a problem with jquery included in the theme and the jquery of piwik? or could this be a problem that my piwik is on another server?
  • David
    Tue, Jan 21, 2014, 6:44 PM
    Hi Torsten, can you see the analytics code in the page source? The plugin is meant to be used with an analytics server on a different domain. There are no known conflicts between jQuery and Piwik. Did you check or uncheck the tracking of site admins that could possibly be the cause of the missing views?
  • Tue, Jan 21, 2014, 6:53 PM
    Hey, thx for the fast answer, well I have uncheck the tracking for admins. I have enable the analytics but can't see the code in my sourcecode, not with admin and not with normal user. but I test to put the tracking code in my head of the page and disable my jquery include and the tracking works, but my problem ist tha I need jquery in my theme sad
  • Tue, Jan 21, 2014, 6:59 PM
    ok if i enable tracking admin I see the code in my source code
  • Tue, Jan 21, 2014, 7:11 PM
    found that i should enable admin tracking, for normal user too then I see the tracking code as normal user and as admin
  • David
    Tue, Jan 21, 2014, 7:16 PM
    The plugin checks is_siteadmin(), so just switching your role is not enough. If you login as a normal user it should track you regardless of the Track Admin settings. If that is not the case (no tracking code when logging in as normal user) please report it as bug on the bug tracker page ( I'm currently working on an update of this plugin to support Piwik 2, Google Analytics and Google Universal Analytics (the new tracking code). Expect an update in the following week.
  • Tue, Jan 21, 2014, 7:23 PM
    if ($enabled && ((is_siteadmin() === $trackadmin) || $trackadmin)) {
    think there is problem

  • David
    Tue, Jan 21, 2014, 7:41 PM
    Problem should be solved in latest release on github, can you please check? If it works Ill add the Google Analytics options and push out a new version this week.
  • Tue, Jan 21, 2014, 8:27 PM
    yes it is fixed, and I will try :D
  • David
    Thu, Jan 23, 2014, 10:48 PM
    There is a version with support for:
    - Google Analytics
    - Google Universal Analytics
    - Piwik 2.0

    now on the github repo. I will package these after full testing and update of the readme, but feel free to test it yourself.
  • David
    Wed, Mar 12, 2014, 3:18 AM
    Updated version added with selectable analytics types. If you would like to know how to install Piwik feel free to contact me.
  • David
    Sat, Mar 15, 2014, 1:10 AM
    A me-culpa for the newly uploaded version, where I gave credits in description and readme, it was missing from the copyright section in the actual files. Fixed that for the Google Analytics files, as that is largely based on original work by Bas Brands and Gavin Henrick.
  • Fri, Mar 21, 2014, 10:19 PM
    Very neat tool. Would be very cool if Piwik and Moodle's logging be integrated a little bit more with thing such as matching IP address to the username, match course ID in the URL to the name of the course, etc.
Please login to post comments