Merge pull request #995 from MITx/features/rocha/google-analytics-for-course-pages
Add google analytics to course info pages
This commit is contained in:
11
lms/templates/google_analytics.html
Normal file
11
lms/templates/google_analytics.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<script type="text/javascript">
|
||||
var _gaq = _gaq || [];
|
||||
_gaq.push(['_setAccount', 'UA-35248639-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>
|
||||
@@ -21,20 +21,9 @@
|
||||
<meta name="path_prefix" content="${MITX_ROOT_URL}">
|
||||
|
||||
% if not course:
|
||||
<script type="text/javascript">
|
||||
|
||||
var _gaq = _gaq || [];
|
||||
_gaq.push(['_setAccount', 'UA-35248639-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>
|
||||
<%include file="google_analytics.html" />
|
||||
% endif
|
||||
|
||||
</head>
|
||||
|
||||
<body class="<%block name='bodyclass'/>">
|
||||
|
||||
@@ -7,7 +7,12 @@
|
||||
|
||||
<%inherit file="../main.html" />
|
||||
|
||||
<%block name="headextra">
|
||||
<%include file="../google_analytics.html" />
|
||||
</%block>
|
||||
|
||||
<%block name="js_extra">
|
||||
|
||||
% if not registered:
|
||||
%if user.is_authenticated():
|
||||
## If the user is authenticated, clicking the enroll button just submits a form
|
||||
|
||||
Reference in New Issue
Block a user