diff --git a/services/web/app/views/project/list/side-bar.pug b/services/web/app/views/project/list/side-bar.pug index a27f4d4e8f..e24dddc2dc 100644 --- a/services/web/app/views/project/list/side-bar.pug +++ b/services/web/app/views/project/list/side-bar.pug @@ -161,10 +161,10 @@ hr p.small #{translate("on_free_sl")} p - a(href="/user/subscription/plans").btn.btn-primary #{translate("upgrade")} + a(href="/user/subscription/plans" ng-click="upgradeSubscription()").btn.btn-primary #{translate("upgrade")} p.small.text-centered | #{translate("or_unlock_features_bonus")} - a(href="/user/bonus") #{translate("sharing_sl")}. + a(href="/user/bonus" ng-click="share()") #{translate("sharing_sl")}. script. diff --git a/services/web/app/views/subscriptions/dashboard.pug b/services/web/app/views/subscriptions/dashboard.pug index 1d7b081a56..e0eb05e0d6 100644 --- a/services/web/app/views/subscriptions/dashboard.pug +++ b/services/web/app/views/subscriptions/dashboard.pug @@ -50,4 +50,4 @@ block content -else p(ng-non-bindable) You're on the #{settings.appName} Free plan. | - a(href="/user/subscription/plans").btn.btn-primary Upgrade now + a(ng-controller="UpgradeSubscriptionController" href="/user/subscription/plans" ng-click="upgradeSubscription()").btn.btn-primary Upgrade now diff --git a/services/web/frontend/js/main.js b/services/web/frontend/js/main.js index 29a31a4355..397b92214f 100644 --- a/services/web/frontend/js/main.js +++ b/services/web/frontend/js/main.js @@ -27,6 +27,7 @@ define([ 'main/annual-upgrade', 'main/register-users', 'main/subscription/team-invite-controller', + 'main/subscription/upgrade-subscription', 'main/contact-us', 'main/learn', 'main/exposed-settings', diff --git a/services/web/frontend/js/main/project-list/left-hand-menu-promo-controller.js b/services/web/frontend/js/main/project-list/left-hand-menu-promo-controller.js index d57ccc28be..63b367e1e5 100644 --- a/services/web/frontend/js/main/project-list/left-hand-menu-promo-controller.js +++ b/services/web/frontend/js/main/project-list/left-hand-menu-promo-controller.js @@ -1,11 +1,20 @@ define(['base'], App => App.controller('LeftHandMenuPromoController', function( $scope, - UserAffiliationsDataService + UserAffiliationsDataService, + eventTracking ) { $scope.hasProjects = window.data.projects.length > 0 $scope.userHasNoSubscription = window.userHasNoSubscription + $scope.upgradeSubscription = function() { + eventTracking.send('subscription-funnel', 'project-page', 'upgrade') + } + + $scope.share = function() { + eventTracking.send('subscription-funnel', 'project-page', 'sharing') + } + const _userHasNoAffiliation = function() { $scope.userEmails = [] $scope.userAffiliations = [] diff --git a/services/web/frontend/js/main/subscription/upgrade-subscription.js b/services/web/frontend/js/main/subscription/upgrade-subscription.js new file mode 100644 index 0000000000..ea2f261a7c --- /dev/null +++ b/services/web/frontend/js/main/subscription/upgrade-subscription.js @@ -0,0 +1,9 @@ +define(['base'], App => + App.controller('UpgradeSubscriptionController', function( + $scope, + eventTracking + ) { + $scope.upgradeSubscription = function() { + eventTracking.send('subscription-funnel', 'subscription-page', 'upgrade') + } + }))