Data helps to inform decisions, I get that. I was talking to my manager about the future infrastructure of our moodlesphere, specifically, how many servers to host our instances, he said "Do we have analytics set up?" My blank stare probably answered his question, but I responded anyway, "Ummm, well, moodle reports its own statistics pretty well". Adding Google analytics is a good idea, I think. I will admit, I am just jumping in without much analysis on tradeoffs. I was inspired by a speaker at a Christian retreat who said something like "Know your voice and take a leap of faith". Avoid paralysis by analysis, which sounds like "well, I'm not sure if we should do that, it may be helpful or it may be harmful, we need more statistical analysis and information..."
According to the Moodle and Google Analytics post, it is wise to place the analytics code in the footer.html file of the active theme. That looks like this for each of the sites I set this up on.
Place the code in the theme\theme name\footer.html
For each of the moodle instances where we wanted to measure When I started adding accounts, it was pretty simple, I had to create a php file that houses the code for the counter, that looks like this:, I had to remove the opening and closing < > from the script tag so blogger would not think I was trying to execute code.Create a new php file containing this javascript
script type="text/javascript"The _gaq.push(_) function is passing 'setAccount' and a unique tracking number to Google. That is the id used to keep track of this page. I have set up 5 counters to track 5 sites, but only at the front door. I am not tracking within the site. I may come back later and add additional trackers to pages. Start simple and see if anything useful comes from this.
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-31306940-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
/script
This is the home page of my analytics account. I did not have to create a new google account, just a new analytics account.
I wonder how many db tables and indexes must be in use to keep track of all the page requests made to your site. What about the really busy sites? I can not imagine how many records that must be. The universe comes to mind.
No comments:
Post a Comment