mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 16:03:37 -05:00
Merge pull request #1561 from sharelatex/jel-subscription-events
Also send subscription events to Google Analytics GitOrigin-RevId: b1a078550c7c92863f3d8225aa78b9240faa2e72
This commit is contained in:
parent
46c6d11574
commit
e5d453454e
1 changed files with 5 additions and 0 deletions
|
@ -27,12 +27,14 @@ define(['base', 'directives/creditCards', 'libs/recurly-4.8.5'], App =>
|
||||||
event_tracking.sendMB('subscription-form-switch-to-student', {
|
event_tracking.sendMB('subscription-form-switch-to-student', {
|
||||||
plan: window.plan_code
|
plan: window.plan_code
|
||||||
})
|
})
|
||||||
|
event_tracking.send('subscription-funnel', 'subscription-form-switch-to-student', window.plan_code)
|
||||||
window.location = `/user/subscription/new?planCode=${planCode}¤cy=${
|
window.location = `/user/subscription/new?planCode=${planCode}¤cy=${
|
||||||
$scope.currencyCode
|
$scope.currencyCode
|
||||||
}&cc=${$scope.data.coupon}`
|
}&cc=${$scope.data.coupon}`
|
||||||
}
|
}
|
||||||
|
|
||||||
event_tracking.sendMB('subscription-form', { plan: window.plan_code })
|
event_tracking.sendMB('subscription-form', { plan: window.plan_code })
|
||||||
|
event_tracking.send('subscription-funnel', 'subscription-form-viewed', window.plan_code)
|
||||||
|
|
||||||
$scope.paymentMethod = { value: 'credit_card' }
|
$scope.paymentMethod = { value: 'credit_card' }
|
||||||
|
|
||||||
|
@ -164,6 +166,7 @@ define(['base', 'directives/creditCards', 'libs/recurly-4.8.5'], App =>
|
||||||
$scope.validation.errorFields = {}
|
$scope.validation.errorFields = {}
|
||||||
if (err != null) {
|
if (err != null) {
|
||||||
event_tracking.sendMB('subscription-error', err)
|
event_tracking.sendMB('subscription-error', err)
|
||||||
|
event_tracking.send('subscription-funnel', 'subscription-error')
|
||||||
// We may or may not be in a digest loop here depending on
|
// We may or may not be in a digest loop here depending on
|
||||||
// whether recurly could do validation locally, so do it async
|
// whether recurly could do validation locally, so do it async
|
||||||
$scope.$evalAsync(function() {
|
$scope.$evalAsync(function() {
|
||||||
|
@ -200,11 +203,13 @@ define(['base', 'directives/creditCards', 'libs/recurly-4.8.5'], App =>
|
||||||
coupon_code: postData.subscriptionDetails.coupon_code,
|
coupon_code: postData.subscriptionDetails.coupon_code,
|
||||||
isPaypal: postData.subscriptionDetails.isPaypal
|
isPaypal: postData.subscriptionDetails.isPaypal
|
||||||
})
|
})
|
||||||
|
event_tracking.send('subscription-funnel', 'subscription-form-submitted', postData.subscriptionDetails.plan_code)
|
||||||
|
|
||||||
return $http
|
return $http
|
||||||
.post('/user/subscription/create', postData)
|
.post('/user/subscription/create', postData)
|
||||||
.then(function() {
|
.then(function() {
|
||||||
event_tracking.sendMB('subscription-submission-success')
|
event_tracking.sendMB('subscription-submission-success')
|
||||||
|
event_tracking.send('subscription-funnel', 'subscription-submission-success', postData.subscriptionDetails.plan_code)
|
||||||
window.location.href = '/user/subscription/thank-you'
|
window.location.href = '/user/subscription/thank-you'
|
||||||
})
|
})
|
||||||
.catch(function() {
|
.catch(function() {
|
||||||
|
|
Loading…
Reference in a new issue