Using Google Analytics and Moodle
Sometimes Moodle’s reporting feature doesn’t do what you want it to. If that is the case for you a great tool for doing website usage analysis is Google Analytics. Google Analytics is now also available for intranets which means you can use it in Moodle.
First sign up for a Google Analytics account, select Add Website Profile and fill in the url to your Moodle installation. Then Analytics will give you a small piece of JavaScript code which it asks you to include in any pages you want tracked.
To add this to Moodle use the HTML block feature of your course:

Then paste the code provided by Analytics into this block (keeping the block heading blank and making sure to toggle the html source button to code view):

Now position your block so that it is on the left right of the Moodle page and below all other blocks:
(Note: I updated this instruction thanks to taming Moodle. I think this was because my particular course did not have a third column. If you have three columns use the right-hand one).

You may have to wait a few hours for Google Analytics to find and detect your Moodle site but once it does you will have a very powerful tool for monitoring all sorts of activity going on in Moodle.

Google Analytics is a full blown tool for professional webmasters and marketeers. There is way too many features to go into here. It doesn’t track users like Moodle does and it relies on JavaScript which has accessibility implications. However what it does do is give very detailed results of page hits and very quickly unlike the Moodle reporting which can be slow to work with.

[...] rElearn » Archives » Using Google Analytics and Moodle (tags: Moodle analytics) [...]
Isn’t it better to modify your theme and add it to footer?
With this approach you may encounter sometimes slow loading of rest of the page, I would put this in the bottom right..
Wait a minute, you only want to monitor front page of your course? In that case this is a brilliant and easy idea.
Hi @PK
This allows a humble editing teacher to add it to their course.
Yes it is better to modify your theme and add it to the footer. But most of us can only dream of having the super-powers of a Moodle admin
If they wanted to add it to individual pages they would have to paste it in there too yes so its not a great solution admittedly but may do for some purposes.
The reason it needs to go at the bottom is that I presume so that it is below any links it needs to track. A quick look in Firebug showed me that the bottom left block appeared furthest down the code in the page (though it seems like it should be the right hand side). That was pretty long-winded!
BTW like your blog
- Eamon
Good one! Can I translate it to Brazilian Portuguese?
Yeah @Tiago no problem.