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
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
You robably already sorted it out, but for those reading this, the GA code has changed a bit and now they suggest putting it right before the </HEAD> tag on each page.
The easiest solution is, as it it is mentioned above, going to the Site Administration block "Site Administration > Appearance > Additional HTML " and chose where to automatically put it in each and every page (though I myself am struggling with some erratic behaviout at the time being)...
Hope this helps.
Regards,
-- joão
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...
-
Allow specific user roles to be excluded.
-
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?
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
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.
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
is there any 'google analytics' block ??
i found something like this
but that is for 1.9
pls help me is any of you knows
-
murad
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
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!
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.
Hello All,
I tried to insert the GA code using this procedure and it is nor working (Moodle 2.8.5)
- I am quite sure the code is exactly as it shows on the Google Analytics Admin page
- I used the Site Administration > Appearance > Additional HTML approach
- I inserted it using the option that puts it right before the </HEAD>
- I already checked and the code is indeed on the page,
however - When checking on GA Admin page it says it is not installed and hence it does not do any stats
...Could this meta tag be the culprit? They do say to put the GA code "immediately before" the </HEAD> tag...
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-99999999-1', 'auto');
ga('send', 'pageview');
</script> <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body ...
And if so what can I do? It is an Administrator form so I have no other control whatsoever... Shall I open an bug report?
Any comments will be greatly appreciated.
Best regards,
-- joão
Hello All,
I have been using Moodle Analytics for about 6 months and in the last 2 it has stopped collecting statistics. I did have a migration to a different server, however these are the only things I know, and i'm running out of answers as to what has happened.
Moodle Analytics worked when:
- The following code was used (id is now **):
<!-- MoodleAnalytics --> <script type="text/javascript"> var _paq = _paq || []; _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="//app.moodleanalytics.com/"; _paq.push(['setTrackerUrl', u+'analytics.php']); _paq.push(['setSiteId', ***]); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'analytics.js.php'; s.parentNode.insertBefore(g,s); })(); </script> <noscript><p><img src="//app.moodleanalytics.com/analytics.php?idsite=***" style="border:0;" alt="" /></p></noscript> <!-- End MoodleAnalytics Code -->
- Code was placed in Site Administration > Appearance >Additional HTML in the <BODY> tag - "Before the BODY is closed" section.
Now it's broken:
- I know that URL has moved from HTTP:// to HTTPS:/
- Several other errors 'database write permissions are occurring
- This has occurred on my DEV and UAT environments
- It is currently sitting internally ONLY (i.e. behind the firewall)
- IT have introduced a Microsoft 365 single compulsory account which must be logged into to access SITE ADMIN menu (could this be blocking it)?
Could anyone please provide assistance?
Thanks
Leticia
I had written out a few ideas, but thought I should go to the URL to try it myself. When your local site is HTTPS, the URL structure of their code included in your page allows the request to be made via HTTPS - and in this case their HTTPS certificate is rejected by Chrome. There could be something fishy going on, but it's more likely their environment is mis-configured.
Do you have HTTPS on both of your Dev and UAT environments?
Example link:
https://app.moodleanalytics.com/analytics.php?idsite=1234
Additionally, the certificate is 2 years expired:
So, it's probably not you - it's them.