mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
testing out new google analytics
This commit is contained in:
parent
1842a65b83
commit
64257a7b2c
3 changed files with 15 additions and 1 deletions
|
@ -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>
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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)->
|
||||
|
|
Loading…
Reference in a new issue