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


  • David
    Wed, May 21, 2014, 4:21 PM
    Hi Sumit,

    did you enable admin tracking? Otherwise your user will not be tracked (but everyone else that is not an admin will). Just for verification, the Site ID field takes the value UA-XXXXXX-XX (where X are numbers).

  • Thu, May 22, 2014, 12:25 AM
    Hi David, thanks for the response, Yes, I did have admin tracking on and I had the right Site ID. Good news is now I am seeing analytics data on my GA dashboard. I guess it takes some time for GA to capture the data to report. So, all good now!

    I really like how the pages are not being reported in generic fashion (blah/blah.php?id=3) but rather more descriptive. Great plugin!

  • Sun, Jul 20, 2014, 11:01 AM
    Hi David,

    First of, thanks for the awesome development towards creating this plugin. !!

    Does it also track if a user performs a download of a document file/any files ?

  • David
    Wed, Aug 27, 2014, 6:58 AM
    hi Sam,
    it does when you use piwik, however it does not when using Google Analytics. This is because piwik uses auto detect for downloads where as Google would need code to achieve this.
  • Wed, Oct 8, 2014, 4:48 PM
    Hi David, looks like a great plugin. Have just installed (along with latest version of Piwik on same server as my Moodle Dev environment.) But I don't seem to be getting any real time stats?

    Site Id is: 1
    Site URL is:
    The only thing I was a little unsure of was formatting of analytics URL - I've currently added it as 

    any help appreciated.
  • David
    Wed, Oct 8, 2014, 5:16 PM
    Hi Chris, the analytics URL is the URL to your piwik installation so should be correct. If you are not getting realtime stats, make sure you have enabled admin tracking as you are more than likely logged in as admin.

    When looking at the source of your Moodle it appears that there is a space after the analytics URL in your settings, so you need to remove that to make it work.

    Also, please grab the version I just uploaded as there was a slight bug with the previous version that did not correctly send page URL Titles.
  • Wed, Oct 8, 2014, 5:40 PM
    Cheers for the quick response David! installed new version and re-entered url, working as expected now smile
  • Wed, Oct 8, 2014, 6:31 PM
    Hi David, how long does it take for the 'Page Titles' report top populate (normally)? no results so far...?
  • David
    Wed, Oct 8, 2014, 6:31 PM
    Chris, please update again, I have further updated the plugin tracking code formatting, so linktracking and downlaod tracking is more reliable now.
  • Wed, Oct 8, 2014, 8:44 PM
    I have updated again (12pm today) still getting error or blank screen on Page Titles sad
  • David
    Wed, Oct 8, 2014, 11:35 PM
    Hi Chris, if you can give me access to both the Moodle and Piwik I can take a look for you. As far as I can see from Public it should work.
  • Thu, Oct 9, 2014, 3:54 PM
    Hi David, it seems to be working now, must have taken a while to populate, thanks for your help, will get on and try making some reports now!
  • Mon, Oct 20, 2014, 11:54 PM
    As requested by David Bezemer, we have changed the lead maintainer of this plugin to Bas Brands who will maintain it from now on. Welcome Bas, and good luck.
  • Sun, Nov 2, 2014, 5:03 AM
    This plugin is also compatible with the free elearning analytics service
  • Mon, Aug 24, 2015, 10:17 PM
    Thanks for sharing the plugin smile
    Only FYI, my localhost did not tracking anything until I copied&pasted the JS code in the additional HTML section in the Moodle platform (2.9.x).
Please login to post comments