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:
David Ormsbee
2012-10-30 13:48:36 -07:00
3 changed files with 18 additions and 13 deletions

View 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>

View File

@@ -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'/>">

View File

@@ -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