From 4f7c2deca5440c3489e1ca60a3994f750101a978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Alby?= Date: Tue, 12 Nov 2019 15:56:24 +0700 Subject: [PATCH] Merge pull request #2345 from overleaf/ta-itm-campaign-improvements ITM Fields Improvements GitOrigin-RevId: 7e9a46dc2b935e2cad8cb8d2e21dfa3c81291c2d --- .../web/app/views/subscriptions/_plans_page_mixins.pug | 8 ++++---- services/web/frontend/js/main/new-subscription.js | 4 +++- services/web/frontend/js/main/plans.js | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/services/web/app/views/subscriptions/_plans_page_mixins.pug b/services/web/app/views/subscriptions/_plans_page_mixins.pug index 5a86a22806..7874add50f 100644 --- a/services/web/app/views/subscriptions/_plans_page_mixins.pug +++ b/services/web/app/views/subscriptions/_plans_page_mixins.pug @@ -1,7 +1,7 @@ //- Buy Buttons mixin btn_buy_collaborator(location) a.btn.btn-primary( - ng-href="/user/subscription/new?planCode={{ getCollaboratorPlanCode() }}¤cy={{currencyCode}}", + ng-href="/user/subscription/new?planCode={{ getCollaboratorPlanCode() }}¤cy={{currencyCode}}&itm_campaign=plans&itm_content=" + location, ng-click="signUpNowClicked('collaborator','" + location + "')" ) span(ng-show="ui.view != 'annual'") #{translate("start_free_trial")} @@ -15,7 +15,7 @@ mixin btn_buy_free(location) span.text-capitalize #{translate('get_started_now')} mixin btn_buy_professional(location) a.btn.btn-primary( - ng-href="/user/subscription/new?planCode=professional{{ ui.view == 'annual' && '-annual' || planQueryString}}¤cy={{currencyCode}}" + ng-href="/user/subscription/new?planCode=professional{{ ui.view == 'annual' && '-annual' || planQueryString}}¤cy={{currencyCode}}&itm_campaign=plans&itm_content=" + location, ng-click="signUpNowClicked('professional','" + location + "')" ) span(ng-show="ui.view != 'annual'") #{translate("start_free_trial")} @@ -23,13 +23,13 @@ mixin btn_buy_professional(location) mixin btn_buy_student(location, plan) if plan == 'annual' a.btn.btn-primary( - ng-href="/user/subscription/new?planCode=student-annual¤cy={{currencyCode}}", + ng-href="/user/subscription/new?planCode=student-annual¤cy={{currencyCode}}&itm_campaign=plans&itm_content=" + location, ng-click="signUpNowClicked('student-annual','" + location + "')" ) #{translate("buy_now")} else //- planQueryString will contain _free_trial_7_days a.btn.btn-primary( - ng-href="/user/subscription/new?planCode=student{{planQueryString}}¤cy={{currencyCode}}", + ng-href="/user/subscription/new?planCode=student{{planQueryString}}¤cy={{currencyCode}}&itm_campaign=plans&itm_content=" + location, ng-click="signUpNowClicked('student-monthly','" + location + "')" ) #{translate("start_free_trial")} diff --git a/services/web/frontend/js/main/new-subscription.js b/services/web/frontend/js/main/new-subscription.js index 08c00910a9..c2d6c7c333 100644 --- a/services/web/frontend/js/main/new-subscription.js +++ b/services/web/frontend/js/main/new-subscription.js @@ -36,7 +36,9 @@ define(['base', 'directives/creditCards'], App => ) window.location = `/user/subscription/new?planCode=${planCode}¤cy=${ $scope.currencyCode - }&cc=${$scope.data.coupon}` + }&cc=${$scope.data.coupon}&itm_campaign=${ + window.ITMCampaign + }&itm_content=${window.ITMContent}` } eventTracking.sendMB('subscription-form', { plan: window.plan_code }) diff --git a/services/web/frontend/js/main/plans.js b/services/web/frontend/js/main/plans.js index e460f499dd..c10ec13df2 100644 --- a/services/web/frontend/js/main/plans.js +++ b/services/web/frontend/js/main/plans.js @@ -416,7 +416,7 @@ define(['base'], function(App) { $scope.purchase = function() { let { plan_code, size, usage, currency } = $scope.selected plan_code = `group_${plan_code}_${size}_${usage}` - window.location = `/user/subscription/new?planCode=${plan_code}¤cy=${currency}` + window.location = `/user/subscription/new?planCode=${plan_code}¤cy=${currency}&itm_campaign=groups` } $scope.payByInvoice = function() {