testing out new google analytics

This commit is contained in:
Henry Oswald 2014-03-05 15:45:24 +00:00
parent 1842a65b83
commit 64257a7b2c
3 changed files with 15 additions and 1 deletions

View file

@ -47,7 +47,7 @@ templates.passwordReset =
<h1 class="h1">Password Reset</h1>
<p>
Your password has been reset, the new password is <p> {{newPassword}}
<p>
<p>
please <a href="https://www.sharelatex.com/login">login here</a> and then change your password <a href=#{Settings.siteUrl}/user/settings> in your user settings</a>
</p>

View file

@ -26,6 +26,15 @@ html(itemscope, itemtype='http://schema.org/Product')
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
// this is the new google analytics https://developers.google.com/analytics/devguides/collection/analyticsjs/
(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', '#{gaToken}', 'auto');
ga('send', 'pageview');
- if (typeof(mixpanelToken) != "undefined")
script(type="text/javascript")
(function(c,a){window.mixpanel=a;var b,d,h,e;b=c.createElement("script");

View file

@ -31,7 +31,9 @@ require [
success: (data)->
if data.message?
new Message data.message
ga('send', 'event', 'register', 'failure')
else
ga('send', 'event', 'register', 'success')
window.location = data.redir || "/project"
@ -79,9 +81,12 @@ require [
success: (data)->
if data.message
new Message data.message
ga('send', 'event', 'login', 'failure')
else if data.redir
window.location.href = data.redir
ga('send', 'event', 'login', 'success')
else
ga('send', 'event', 'login', 'success')
window.location.href = '/project'
$('form#passwordReset').submit (event)->