diff --git a/services/web/public/src/main/new-subscription.js b/services/web/public/src/main/new-subscription.js index 10d994a7ab..3f67bc6ac3 100644 --- a/services/web/public/src/main/new-subscription.js +++ b/services/web/public/src/main/new-subscription.js @@ -27,12 +27,14 @@ define(['base', 'directives/creditCards', 'libs/recurly-4.8.5'], App => event_tracking.sendMB('subscription-form-switch-to-student', { 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=${ $scope.currencyCode }&cc=${$scope.data.coupon}` } 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' } @@ -164,6 +166,7 @@ define(['base', 'directives/creditCards', 'libs/recurly-4.8.5'], App => $scope.validation.errorFields = {} if (err != null) { 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 // whether recurly could do validation locally, so do it async $scope.$evalAsync(function() { @@ -200,11 +203,13 @@ define(['base', 'directives/creditCards', 'libs/recurly-4.8.5'], App => coupon_code: postData.subscriptionDetails.coupon_code, isPaypal: postData.subscriptionDetails.isPaypal }) + event_tracking.send('subscription-funnel', 'subscription-form-submitted', postData.subscriptionDetails.plan_code) return $http .post('/user/subscription/create', postData) .then(function() { 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' }) .catch(function() {