Data analysis

If these described reporting facilities do not satisfy your hunger for usage data, you might consider using external web analysis tools, such as web log analyzers. You can also utilize a live data tracking system, such as Piwik and Google Analytics, that can be embedded in your Moodle site.

Web log analyzers

Web servers, such as Apache and Microsoft IIS, keep textual log files that keep track of every hit on a website. The fields and their formats can be customized so that each log file will look potentially different from the other. The following two lines are from our Moodle test site (IP addresses have been replaced and server directories are shortened):

123.45.67.89 - - [26/Feb/2015:08:15:30 +0000] "GET .../synergy-learning/packt/httpdocs/course/view.php?id=3 HTTP/1.0" 404 1045 "-""-"
123.45.67.89 - - [26/Feb/2015:08:15:30 +0000] "GET .../synergy-learning/packt/httpdocs/mod/quiz/view.php?id=12 HTTP/1.0" 404 2180"-""-"

As you can see, these files are not meant to be read by human beings. Instead, a web log analysis software exists, which can read and interpret these files. Open source examples are AWStats, Webalizer, and munin; a popular commercial product is WebTrends.

These tools produce detailed statistics that look at the log files from every possible angle. The problem when using web log analyzers with Moodle is that they are database-driven, which requires parameterized URLs (the ?id=12 part). You will have to configure the software you use to reflect these parameters, for example, at the course level.

Google Analytics and Piwik

Google Analytics and Piwik are two feature-rich services that track any traffic to your Moodle site and offer an abundance of statistics on visitors, traffic sources, content, user-defined goals, and much more.

In order to support either of the two systems, you will need to install the Analytics plugin (https://moodle.org/plugins/local_analytics), which lets you configure the connection between your Moodle system and the tracker. It provides a means of sending Clean URLs, which overcome the issue of the parameterized URLs that we came across when looking at web log analyzers.

Google Analytics and Piwik

Google Analytics is a free service (https://www.google.com/analytics) that tracks any traffic to your site, but you will have to sign up for an account first.

An elegant way to incorporate Google Analytics is via the Essential Theme, which we briefly covered in Chapter 7, Moodle Look and Feel. It not only supports the enabling of Google Analytics on your site but also lets you specify your tracking ID.

If you do not have access to a theme that has been built-in Google Analytics support, you will have to add the following piece of code to the footer.html file of your theme before the </body>tag (this will be generated by Google Analytics for you):

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-XXXXXXXX-X', 'auto');
ga('send', 'pageview');

</script>

You need to update XXXXXXXX-X in the preceding sample with your own Google Analytics account number. While it is possible to add the code in the header.html file, it is not recommended that you do this as it has an impact on the perceived performance of your system.

Once setup, you will be able to see the powerful analytics of your Moodle site, as shown in the following screenshot:

Google Analytics and Piwik

If Google Analytics appeals to you, but you need to store your data locally, Piwik is a very good alternative. Piwik (http://piwik.org/) is an open source alternative to Google Analytics, which can be installed on a local server and used for other websites as well.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.75.221