Google analytics in Moodle course

I just read interesting post yesterday about adding Google analytics code for easier and faster monitoring your users here http://www.relearn.ie/2008/04/16/using-google-analytics-and-moodle/

Google analytics is a free tool for monitoring your site, watching visitors habits, provide lot of statistics , widely used by site creators. Check GA site to learn more.

This was quite a new for me. I did installed GA in Moodle too, but I have inserted it into the footer file in the theme. In this case GA is "watching" all your pages, all courses(I assume I am using only one theme), just everything. This could be useful, but too overcrowded with informations as you monitor all pages on your site. And you need to have access to themes of course ;).

Approach mentioned higher has some serious disadvantages, that is monitoring only front page of the course where GA code is inserted, but has one GREAT advantage. It is easy, teacher can add GA code himself, no asking and begging needed.

So if you are teacher and need something for your course (for example you want to learn what browser resolutions your students are using etc) go that way. Mentioned post is very descriptive and useful.

I am not sure about position of the block itself. GA code is usually placed to footer area of the pages or as lowest as possible. And if I am not wrong, lowest right is farthest in the code. Moodle will print left column first, then middle (well known error when you didn't upgraded all third party modules and printing of content halts after only a few topics due a missing activity or module) and right column finally.

My advice is to move the GA block to the right bottom. Eamon from the rElearn.ie wrote in the comments that he used Firebug to find best position. I just checked source code of Moodle courses and imho right lowest block is farthest in the code.

So if someone will make some experiments about positioning of the GA block, please share it.


Confirmation email sender

I wrote about confirmation emails here. I noticed I missed one thing, you can have problem about. Who is sending them?

Admin does that! Or better, confirmations emails are sent from email address that is set up in admin account. If you have more admins, it's primary admin, that is the first one, he was created when the Moodle has been installed. Change his email address and confirmation emails sender address should be changed too.


Reset role to default

Did you play with roles settings but suddenly something is not working correctly and you don't know which change is the culprit? Did you want to reset role to default and can't find button? I know solution!

I read about role resetting to default on moodle forums but couldn't find mentioned button, but I noticed in the code, that the needed part is there.

So try to edit role you want to reset

Editing page will show up. Look into address bar, there you should see something like this:

http://yourmoodleurl.com/admin/roles/manage.php?action=edit&roleid=7 (the number denotes role id you are editing)

Change action=edit to action=reset. Everything others stays as before!

Press enter. You should see notice, if you are sure to reset role to default. If you are, reset it ;-).

Let me know, if you found easier way, I tried 1.8.2 and 1.9 versions but cannot find resetting button :-(.

Unable to reset password in Moodle

You might know that Moodle helps your lost users not knowing their's password by resetting it.(It depends on the authentication plugin though.)

User needs to insert username, or registration email, Mooodle will send mail with link to reset that password. This is somehow cumbersome but it disallow pranks from malicious users trying to disable another user access.

But it can happen, that mail without the password reset confirmation links is sent. It contains these lines:
"Unfortunately your account on this site is disabled and can not be reset,
please contact the site administrator,"

In these cases please check if:

  1. authentication plugin user had been registered with is enabled
  2. user is not disallowed from login with 'nologin' tag in his authentication column in the DB
  3. user has rights for changing his password - moodle/user:changeownpassword (Moodle 1.9)
  4. authentication plugin contains these lines:

function can_change_password() {
return true;

Hope this will help solve problem with resetting passwords.