catalyst / moodle-tool_webanalytics

A Moodle admin tool adding Web Analytics to your Moodle site.
https://moodle.org/plugins/tool_webanalytics
7 stars 11 forks source link

Matomo UserId receiving the Moodle username #29

Closed ph7ti closed 4 years ago

ph7ti commented 4 years ago

Hi, is possible the Matomo UserId recive a moodle login username? Is very unusual search in moodle their user ID in comparision a Matomo interface, hindering the definitive implementation of Matomo / Piwik. I noticed that in a part of the code the moodle userid ($ USER-> id) is indicated, when trying to replace directly in the analytics/classes/api/piwik.php page there was no change, which frustrated me a lot :(

dmitriim commented 4 years ago

Hi @ph7ti It's not possible to do at the moment as user id is hardcoded to USER-> id. But I think this feature could be easily implemented I see this as a new setting in the matomo subplugin to actually pick one of the current user fields to use as userid for Matomo. So please feel free to submit a pull request.

One thing we need to consider is uniqueness of the selected field. E.g. email is not always unique in moodle.

dmitriim commented 4 years ago

Hey @ph7ti This feature has been implemented. Please upgrade your plugin to the latest version.