Skip to content

Commit

Permalink
Merge pull request #58 from harvard-canvas-branding/hotfix/v2.6.6.2
Browse files Browse the repository at this point in the history
Rename the ga variable to harvardga
  • Loading branch information
cmurtaugh authored Sep 10, 2019
2 parents afb6615 + 45e3c5d commit f88fe2c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions js/google_analytics.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
(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');
})(window,document,'script','//www.google-analytics.com/analytics.js','harvardga');

ga('create', 'UA-49649810-4', 'auto');
harvardga('create', 'UA-49649810-4', 'auto');
try {
if (typeof ENV !== 'undefined') {
ga('set', 'dimension1', ENV.COURSE_ID);
harvardga('set', 'dimension1', ENV.COURSE_ID);

if ( ENV.current_user_roles.indexOf('admin') != -1 ) {
ga('set', 'dimension2', 'admin');
harvardga('set', 'dimension2', 'admin');
}
else if ( ENV.current_user_roles.indexOf('teacher') != -1 ) {
ga('set', 'dimension2', 'teacher');
harvardga('set', 'dimension2', 'teacher');
}
else if ( ENV.current_user_roles.indexOf('student') != -1 ) {
ga('set', 'dimension2', 'student');
harvardga('set', 'dimension2', 'student');
}
else {
ga('set', 'dimension2', 'user');
harvardga('set', 'dimension2', 'user');
}
}
}
Expand All @@ -27,4 +27,4 @@ catch(err) {
}


ga('send', 'pageview');
harvardga('send', 'pageview');

0 comments on commit f88fe2c

Please sign in to comment.