Add Google Analytics to MoodleCloud

Add Google Analytics to MoodleCloud

by Monty Bhatia -
Number of replies: 6

Hi, I was wondering if there is a way to add in google analytics to a moodlecloud site.  Instructions tell me I need to add the tracking code to the html head; however that is not editable as it appears to be overridden in config.php (which we cant change).

Any other options?  What other type of analytics are available from MoodleCloud (page views etc.)?

Thanks.

Average of ratings: -
In reply to Monty Bhatia

Re: Add Google Analytics to MoodleCloud

by SOS MEd -

hi there

i tried these steps and it worked

  1. Get your tracking code from your Google Analytics account.
  2. Go to  installation folder and open “config.php” with a text editor. Go to the end of the file and add. $cfg->additionalhtmlhead = " ".
  3. Paste your tracking code into the “addionalhtmlhead” as shown in the figure below.

Average of ratings:Useful (1)
In reply to Monty Bhatia

Re: Add Google Analytics to MoodleCloud

by Mathieu Petit-Clair -
Picture of Core developers Picture of Moodle HQ Picture of MoodleCloud team Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Hi Monty,

Has you have seen, the additionalhtmlhead config option is indeed locked on MoodleCloud for security reasons. Unfortunately, I don't think there is a way to use Google Analytics on your MoodleCloud site at this time.

Mathieu
Average of ratings:Useful (2)
In reply to Monty Bhatia

Re: Add Google Analytics to MoodleCloud

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

Even if you could track you site with Google Analytics, don't do it! Google is a surveillance infrastructure of unimaginable dimensions and they abuse your data. The very special irony of Google Analytics is that Google doesn't have to do anything actively, it is you, the webmaster, who sends data on each click of your users to Google. So you are sending other's data to Google. The law is catching up with this abuse and it is on the way to become illegal. Even now the major browsers have mechanisms built-in to block this communication.

This is too broad a topic, or rather a whole bag of issues, to be discussed here. But unavoidable we touch it many forums on moodle.org. Here is a random short explanation I found: https://webmasters.stackexchange.com/questions/50824/what-are-the-security-implications-of-using-google-analytics. Please inform yourself.

Generally people don't like to be tracked. There are so many tools and methods to find out whether a site is tracking. So finally the tracking can back-fire depending on the awareness of your users. If you have the trust of users, why don't you collect data transparently? Everybody knows that each click is "trackable" if one is logged in.
In reply to Visvanath Ratnaweera

Re: Add Google Analytics to MoodleCloud

by Monty Bhatia -
Thanks everyone for your help with this.
I did notice that you can put it into the html body and it works just fine.
Having said that we may not even need the analytics portion at this stage based on my discussions with my client as we mainly need reporting details which moodle already supports so I think we are good.

Thanks for all your help with this.
Average of ratings:Useful (2)