Your Moodle version

General plugins (Local): Analytics

local_analytics
Maintained by Picture of David Bezemer David Bezemer
A local Moodle Module adding Analytics. This plugin currently supports 3 Analytics modes, Piwik, Google Universal Analytics and Google Legacy Analytics.
Moodle 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7

moodle-local_analytics
==================

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 http://piwik.org/docs/installation/

Screenshots

Screenshot
Screenshot
Screenshot
Screenshot

Contributors

Picture of David Bezemer
David Bezemer (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Toni Soto
    Sat, Mar 22, 2014, 11:31 PM
    Hi David, what kind of new (extra) features are expected when installing this plugin that we haven't got yet using only piwik embedded code?
  • Picture of David Bezemer
    Sun, Mar 23, 2014, 3:54 AM
    Hi Toni, this plugin offers customized page titles so a taxonomy view is built within Piwik, it also provides the option to select where you want to load the tracking code (head/body/footer) and to disable tracking for your admin users. In the future this plugin will also support additional configurable custom tracking items for very specific tracking tasks. Additionally that will also bring the reports from Piwik into Moodle.
  • Picture of David Bezemer
    Sun, Mar 23, 2014, 7:30 PM
    Added a few screenshots to clarify the additional benefits showing as taxonomy/treeview. In Google Analytic this also works as drilldown levels.
  • Picture of Jeff White
    Thu, Apr 17, 2014, 3:08 AM
    Have any other users had problems using the piwik tool where certain reports such as Entry Page, Page Tittles, Exit Page, etc say "There is no data for this report."? I am going through the troubleshooting on Piwik but still have not found a solution.
  • Picture of David Bezemer
    Thu, Apr 17, 2014, 5:38 AM
    Hi Jeff, are you forwarding all incoming data to SSL on your piwik instance? Usually this problem occurs when data is proxied the wrong way before it goes into piwik, like forwarding to SSL.
  • Picture of Jeff White
    Fri, Apr 18, 2014, 9:35 PM
    Hi David, everything is running through port 80. I am thinking this may be more to do with it running on our intranet so I will build another Moodle instance on the same sub-net as the piwik server.
  • Picture of Michael Wuttke
    Mon, Apr 28, 2014, 8:01 PM
    Hello David,

    I tried to use the analytics plugin. I am using moodle 2.6.2, piwik 2.2 and you latest plugin (version 1.3). Piwik is installed on a mysql server (version 5.5.37) and moodle ist installed on a postgresql server (version 9.1.13) . The analytics plugin I installed successfuly on ~/moodle/local via the CLI, I hope. wink

    This is my config of the plugin:
    I enabled Analytics for Moodle;
    I've choosen piwik as the type of Analytics;
    Side ID is 1;
    I enabled Image Tracking for Moodle;
    I inserted the Analytics URL;
    I enabled clean URL &
    the tracking code location is Header.

    When I trie to load a course site I allways recieve the following apache error message:
    [Mon Apr 28 13:45:41 2014] [error] [client 127.0.0.1] Default exception handler: Error reading from database Debug: ERROR: invalid input syntax for integer: ""\nSELECT * FROM mdl_course_categories WHERE id = $1\n[array (\n 0 => '',\n)]\nError code: dmlreadexception\n* line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown\n* line 243 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()\n* line 748 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()\n* line 1428 of /lib/dml/moodle_database.php: call to pgsql_native_moodle_database->get_records_sql()\n* line 1400 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()\n* line 1379 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()\n* line 39 of /local/analytics/piwik.php: call to moodle_database->get_record()\n* line 84 of /local/analytics/piwik.php: call to analytics_trackurl()\n* line 107 of /local/analytics/piwik.php: call to insert_analytics_tracking()\n* line 36 of /local/analytics/lib.php: call to require_once()\n* line 786 of /lib/classes/component.php: call to include_once()\n* line 1276 of /lib/navigationlib.php: call to core_component::get_plugin_list_with_file()\n* line 222 of /blocks/navigation/block_navigation.php: call to global_navigation->initialise()\n* line 178 of /blocks/navigation/block_navigation.php: call to block_navigation->get_navigation()\n* line 296 of /blocks/moodleblock.class.php: call to block_navigation->get_content()\n* line 238 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()\n* line 993 of /lib/blocklib.php: call to block_base->get_content_for_output()\n* line 1045 of /lib/blocklib.php: call to block_manager->create_block_contents()\n* line 361 of /lib/outputrenderers.php: call to block_manager->ensure_content_created()\n* line 25 of /theme/standard/layout/columns3.php: call to core_renderer->standard_head_html()\n* line 870 of /lib/outputrenderers.php: call to include()\n* line 800 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()\n* line 252 of /course/view.php: call to core_renderer->header()\n, referer: https:/myurl/moodle/my/index.php?

    Have you any idea, what is wrong in tte configuration of the plugin or in piwik?

    Thanks for any help,
    Michael
  • Picture of David Bezemer
    Mon, Apr 28, 2014, 9:48 PM
    Michael, this seems to be a problem with the plugin and postgresql. However in my plugin I do not use direct database queries, which would mean that this is a bug in the Moodle core. Apparently it breaks on $DB->get_record("course_categories", array("id" => $cat)). Can you try to see if replacing this (on line 39 in piwik.php) by $DB->get_record("course_categories", array("id" => $cat[0])) does remove the error?
  • Picture of Michael Wuttke
    Mon, Apr 28, 2014, 10:08 PM
    Hello David,

    thanks for your quick response.

    In line 39 of the piwik.php stands now:
    if ($categorydepth = $DB->get_record("course_categories", array("id" => $cat[0]))) {;

    Now I recieve the same error message:
    [Mon Apr 28 16:05:36 2014] [error] [client 127.0.0.1] Default exception handler: Error reading from database Debug: ERROR: invalid input syntax for integer: ""\nSELECT * FROM mdl_course_categories WHERE id = $1\n[array (\n 0 => '',\n)]\nError code: dmlreadexception\n* line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown\n* line 243 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()\n* line 748 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()\n* line 1428 of /lib/dml/moodle_database.php: call to pgsql_native_moodle_database->get_records_sql()\n* line 1400 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()\n* line 1379 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()\n* line 39 of /local/analytics/piwik.php: call to moodle_database->get_record()\n* line 85 of /local/analytics/piwik.php: call to analytics_trackurl()\n* line 108 of /local/analytics/piwik.php: call to insert_analytics_tracking()\n* line 36 of /local/analytics/lib.php: call to require_once()\n* line 786 of /lib/classes/component.php: call to include_once()\n* line 1276 of /lib/navigationlib.php: call to core_component::get_plugin_list_with_file()\n* line 222 of /blocks/navigation/block_navigation.php: call to global_navigation->initialise()\n* line 178 of /blocks/navigation/block_navigation.php: call to block_navigation->get_navigation()\n* line 296 of /blocks/moodleblock.class.php: call to block_navigation->get_content()\n* line 238 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()\n* line 993 of /lib/blocklib.php: call to block_base->get_content_for_output()\n* line 1045 of /lib/blocklib.php: call to block_manager->create_block_contents()\n* line 361 of /lib/outputrenderers.php: call to block_manager->ensure_content_created()\n* line 25 of /theme/standard/layout/columns3.php: call to core_renderer->standard_head_html()\n* line 870 of /lib/outputrenderers.php: call to include()\n* line 800 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()\n* line 252 of /course/view.php: call to core_renderer->header()\n, referer: https://myurl/moodle/my/index.php?

    Michael
  • Picture of David Bezemer
    Mon, Apr 28, 2014, 10:22 PM
    Hi Michael, I think we have discovered a bug in the moodle database handler here, I'll try to file a bug request later today.
  • Picture of Michael Wuttke
    Mon, Apr 28, 2014, 10:40 PM
    Hi David,

    thank you. I will wait. wink

    Michael
  • Picture of David Bezemer
    Tue, Apr 29, 2014, 6:26 PM
    Released a new version to solve the problem reported by Michael, this issue only occurs on PostgreSQL and MSSQL, so if you are using MySQL updating is not necessary, but will not break anything either.
  • Picture of Sumit Gupta
    Wed, May 21, 2014, 3:08 AM
    Hi, I installed the plugin in my website as directed and replaced the Site ID with the Google Analytics Code generated by GA. Also, I have chosen 'Google Universal Analytics' as the Analytics type. However, I am not seeing any data in the GA dashboard. Am I doing something wrong?

    Thanks,
    Sumit
  • Picture of David Bezemer
    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).

    David
  • Picture of Sumit Gupta
    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!

    Thanks,
    Sumit
1 2 3
Please login to post comments