General developer forum

 
 
Satish Talim
Moodle and Google Analytics
 
Is there any way I can add the Google Analytics code to my site created using Moodle?
 
Average of ratings: -
One poor developer...
Re: Moodle and Google Analytics
Group DevelopersGroup Documentation writersGroup Moodle HQGroup Particularly helpful MoodlersGroup Testers
Hi Satish,

I guess that the theme/xxxx/footer.hml (where xxxx is the theme you're using in the site), is a good candidate. Near the end of the file, before the closing </body> tag, I guess.

Ciao smile
 
Average of ratings: -
Satish Talim
Re: Moodle and Google Analytics
 
Thanks Eloy. Have added the code; shall monitor and check if successful.

Satish
 
Average of ratings: -
Picture of Scott Wilson
Re: Moodle and Google Analytics
 

If our Moodle site is hosted by a vendor, do I have access to the footer.html file ... in order to add the Google code?  If so, how do I get to it?  Or do I need to ask the vendor to insert the code?

Scott

 
Average of ratings: -
Picture of Stefan Ramaker
Re: Moodle and Google Analytics
 
Hello Scott,

to download the footer.html you will need a ftp account. If this is not available your vendor can add the code. You should know that this takes about 5 min smile.

I am not sure, but I know, that the code has to get placed before the ending body tag </body>.

So maybe it would be also okay if you add this code on the frontpage in the html-editor in HTML mode. If I am wrong or moodle does not allow these kind of tags, then maybe someone correct my, but it is worth to try it.

Greetings

Stefan
 
Average of ratings: -
Satish Talim
Re: Moodle and Google Analytics
 
I added the Google Analytics (GA) code in my themes' footer.html just before the </body> tag and it works. Have started getting the reports from GA.
 
Average of ratings: -
Picture of Scott Wilson
Re: Moodle and Google Analytics
 

Stefan and Satish,

Thank you for your responses. Since our site is being hosted by a Moodle partner, I don't seem to have access to the code for themes or the footer.html file ... so think that I will need to contact them to add the code.

Scott

 
Average of ratings: -
Picture of A K
Re: Moodle and Google Analytics
 
Do Moodle partners usually place that level of restriction on access to a Moodle system?
 
Average of ratings: -
Picture of Damian Lopez
Re: Moodle and Google Analytics
 

Hi

 

I know that change in the source code is immediate after to just to put the script in the footer.html, but in my case isn't working. I need to do anything else?, restart the apache web server? any suggestions?

 
Average of ratings: -
Picture of Klaus Brune
Re: Moodle and Google Analytics
 

I just put the Google Analytics code on my own site, but, being a programmer and therefore somewhat of a control freak, I can see where we might want some added functionality.

For instance, I don't want my own visits to the site as I'm building courses to show up in my statistics. Ideally, I'd also like to separate statistics for visitors, teachers, students, etc.

I'm not familiar enough with the Moodle code to do this without a bit of research, though. If anyone reading this happens to know what PHP variable holds the data for the currently logged user, that would be great. If I find it first, I'll post it here.

Essentially, I want to duplicate what Drupal's add-in module for Google Analytics does...

  1. Allow specific user roles to be excluded.
  2. Allow user-defined data to be passed on to G.A. such as the user role of the visitor. It's useful to know when 90% of the hits are from teachers, not students, right? smile
 
Average of ratings: -
Picture of Josh OCB
Re: Moodle and Google Analytics
 
Hi Klaus,

Did you manage to get google analytics working with the advanced functionality? I'd be interested to hear if you found a solution.

Thanks
 
Average of ratings: -
Picture of Joyce Seitzinger
Re: Moodle and Google Analytics - distinguish roles
 
Hi Klaus,
Have you made any progress with the ability to distinguish between staff, visitors & student visits? Would be so useful to have.

Thanks,
Joyce
 
Average of ratings: -
Retired!
Re: Moodle and Google Analytics - distinguish roles
 

I'm another wondering about the possibility of that kind of information being collectable.

Regards

Martin

 
Average of ratings: -
Picture of J Rogers
Re: Moodle and Google Analytics
 
One thing you can do from the Google Analytics side is to filter out the IP addresses of particular computers. I use the same computer every day for Moodle testing and development and use this approach.
 
Average of ratings: -
Picture of William Oakes
Re: Moodle and Google Analytics
 
Hi J ( or anyone else who can help)

I put the Google Analytics script in the footer.html of the Custom Corners theme. It does not show anything on the website footer and does not increment the counter on the google site.

You would think something this easy to do would be easy to do. But not for me!

Thanks,

Bill

 
Average of ratings: -
Picture of Jonathan Konrad
Re: Moodle and Google Analytics
Group Moodle Course Creator Certificate holders
Can I register just my course page with Google Analytics? I tried copying and pasting the url with all the "view.php?id=498" stuff in it and Google will not register the site.

I do not wish to analyze our whole Moodle. Just my course. I can make a custom theme for just my course and paste Google's code in the footer. However, I'm not sure how to register it with Google in the first place.

Any thoughts would be helpful. Thank you.
 
Average of ratings: -
Jon
Re: Moodle and Google Analytics
Group Particularly helpful Moodlers
I'm still trying to find a way to install the Google Analytics script on my site. Is there anyone here who is currently using this?
 
Average of ratings: -
Jeff
Re: Moodle and Google Analytics
Group Developers
Jon,

Send me an email and I will do it for you.

Jeff
 
Average of ratings: -
Picture of Kyle Johnson
Re: Moodle and Google Analytics
 
Has anyone successfully got this to work?

The block add in doesn't work as stated and it seems to be abandoned.
 
Average of ratings: -
Jon
Re: Moodle and Google Analytics
Group Particularly helpful Moodlers

Sorry Jeff, I didn't come back to this thread after my last post. I've left the organization I was with that hosts with your company.

I did figure out how to do this though by pasting the Google Analytics code into the footer of each theme.

 
Average of ratings: -
Picture of Graham Clark
Re: Moodle and Google Analytics
 

My Moodle 2.0 installation uses a theme called "Anomaly" which doesn't appear to include a footer.html file. In which case, where do I paste the snippet of Google code? Thanks.

 
Average of ratings: -
Picture of e m
Google Analytic w/ Moodle theme (NO footer.html)
 

Hello.  I'm new.  Started working w/ Moodle about a week ago.  I too am wondering if there is a method of adding Google analytics into a theme that does not seem to have a footer.html file.

I'm using a newer Moodle theme (2.0 I would suspect) and I believe it's called Binarius?

Any help would be greatly appreciated/thank you in advance.

Eric

 
Average of ratings: -
Picture of Judy Unrein
Re: Moodle and Google Analytics
 

Same thing here... I have access to my files and I have my analytics code to paste in, but I don't see any html files in the whole installation.

 
Average of ratings: -
Picture of Murad Parambadan
Re: Moodle and Google Analytics
 

In 2.0 go to Site Administration > Appearance > Additional HTML and copy the Tracking Code from Google Analytics into the 'Within Header' box.

 
Average of ratings:Useful (2)
Picture of Andrew Simpson
Re: Moodle and Google Analytics
 

Hi Murad

This feature would be fantastic - but I can't find it under Site Administration?  I am running Moodle 2.0 - does this feature have to be activated?

I am simply trying to add the Google Analytics code to this site.

Thanks

Andrew

 
Average of ratings: -
Picture of Marius Butuc
Re: Moodle and Google Analytics
 

For page load performance I'd recommend including the Tracking Code from Google Analytics somewhere in the footer instead of header.

 
Average of ratings: -
Picture of Jizu Sun
Re: Moodle and Google Analytics
 

Greate Solution!

 
Average of ratings: -
Picture of Murad Parambadan
Re: Moodle and Google Analytics
 

 

is there any 'google analytics' block ??

i found something like this

http://tracker.moodle.org/browse/CONTRIB-1518?page=com.atlassian.streams.streams-jira-plugin:activity-stream-issue-tab#issue-tabs

but that is for 1.9 sad

pls help me is any of you knows

-

murad

 

 
Average of ratings: -
Picture of Sherwin Binarao
Re: Moodle and Google Analytics
 

Hello everyone.

Google Analytics is a very good statical tool for our Moodle sites.

But instead of changing the codes in the footer you might want to add the GA codes to Site Administration > Appearance > Additional HTML

These settings allow you to specify HTML that you want added to every page. You can set HTML that will be added within the HEAD tag for the page, immediately after the BODY tag has been opened, or immediately before the body tag is closed. Doing this allows you add custom headers or footers on every page, or add support for services like Google Analytics very easily and independent of your chosen theme.


Thanks,

Sherwin

 
Average of ratings:Useful (3)
Picture of David Kimball
Re: Moodle and Google Analytics
 

Thanks Sherwin for replying on this two year old plus thread.  Exactly what I came looking for.  Started tracking immediately.

And for those that follow, if you are following more than one website in GA, you will need to put that extra code in the header.

 
Average of ratings: -
Picture of kiwami livingston
Re: Moodle and Google Analytics
 

Ditto

 
Average of ratings: -
Picture of Mark Glynn
Re: Moodle and Google Analytics
 

I'm very interested in what reports/dashboards that you are generating using Google Analytics. GA is great and can produce data on nearly everything for you but the challenge for me is identifying the right reports to generate.

 

Any thoughts/advice would be welcome

 

Kind regards,

 

Mark

 
Average of ratings: -
Picture of Patricia Loofbourrow
Re: Moodle and Google Analytics
 

What you track really depends on why you have the site there. My moodle is a paid educational subdomain of a informational for-profit site (in other words, a business venture).

So my tracking is aimed at where people are coming from (referring link), the bounce rate (how many left without clicking anything), and how many showed up (unique visitors).

My purpose with this is to figure out ways to increase my visits from a particular website, get them to click on the front page (either to my main site or to look around), or (ultimately) to buy a course! big grin

You main purpose might be very different. A local course that only children from a particular school can enroll in might not need GA at all.

 
Average of ratings: -