diff --git a/services/web/app/views/subscriptions/successful_subscription.jade b/services/web/app/views/subscriptions/successful_subscription.jade index 8413f5e036..17ac4f3594 100644 --- a/services/web/app/views/subscriptions/successful_subscription.jade +++ b/services/web/app/views/subscriptions/successful_subscription.jade @@ -2,7 +2,7 @@ extends ../layout block content .content.content-alt - .container + .container(ng-controller="SuccessfulSubscriptionController") .row .col-md-8.col-md-offset-2 .card(ng-cloak) diff --git a/services/web/public/coffee/ide.coffee b/services/web/public/coffee/ide.coffee index 4e7721badd..ac4240e114 100644 --- a/services/web/public/coffee/ide.coffee +++ b/services/web/public/coffee/ide.coffee @@ -68,22 +68,15 @@ define [ $scope.user = window.user - $scope.startTrialPlanCode = 'collaborator_free_trial_7_days' $scope.shouldABTestPlans = false - $scope._plansVariant = 'default' if $scope.user.signUpDate >= '2011-10-18' $scope.shouldABTestPlans = true - sixpack.participate 'plans-1610', ['default', 'heron', 'ibis'], (chosenVariation, rawResponse)-> - $scope._plansVariant = chosenVariation - if chosenVariation in ['heron', 'ibis'] - $scope.startTrialPlanCode = "collaborator_#{chosenVariation}" $scope.settings = window.userSettings $scope.anonymous = window.anonymous $scope.chat = {} - # Only run the header AB test for newly registered users. _abTestStartDate = new Date(Date.UTC(2016, 8, 28)) _userSignUpDate = new Date(window.user.signUpDate) diff --git a/services/web/public/coffee/main/account-upgrade.coffee b/services/web/public/coffee/main/account-upgrade.coffee index 7d72fe0c13..0da68fddfb 100644 --- a/services/web/public/coffee/main/account-upgrade.coffee +++ b/services/web/public/coffee/main/account-upgrade.coffee @@ -6,12 +6,18 @@ define [ $scope.buttonClass = "btn-primary" $scope.startFreeTrial = (source, couponCode) -> - event_tracking.sendMB "subscription-start-trial", { source, plan: $scope.startTrialPlanCode } + plan = 'collaborator_free_trial_7_days' w = window.open() - ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source) - url = "/user/subscription/new?planCode=#{$scope.startTrialPlanCode}&ssp=true" - if couponCode? - url = "#{url}&cc=#{couponCode}" - $scope.startedFreeTrial = true - w.location = url + sixpack.participate 'plans-1610', ['default', 'heron', 'ibis'], (chosenVariation, rawResponse)-> + if $scope.shouldABTestPlans and chosenVariation in ['heron', 'ibis'] + plan = "collaborator_#{chosenVariation}" + + ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source) + url = "/user/subscription/new?planCode=#{plan}&ssp=true" + if couponCode? + url = "#{url}&cc=#{couponCode}" + + $scope.startedFreeTrial = true + event_tracking.sendMB "subscription-start-trial", { source, plan} + w.location = url diff --git a/services/web/public/coffee/main/plans.coffee b/services/web/public/coffee/main/plans.coffee index 2ea958b876..e08c495b29 100644 --- a/services/web/public/coffee/main/plans.coffee +++ b/services/web/public/coffee/main/plans.coffee @@ -340,8 +340,6 @@ define [ $scope.signUpNowClicked = (plan, annual)-> event_tracking.sendMB 'plans-page-start-trial', {plan} - if $scope.shouldABTestPlans and plan in ['student', 'collaborator'] - sixpack.convert 'plans-1610', () -> if $scope.ui.view == "annual" plan = "#{plan}_annual" event_tracking.send 'subscription-funnel', 'sign_up_now_button', plan diff --git a/services/web/public/coffee/main/subscription-dashboard.coffee b/services/web/public/coffee/main/subscription-dashboard.coffee index 22d68baea5..71bc198e6d 100644 --- a/services/web/public/coffee/main/subscription-dashboard.coffee +++ b/services/web/public/coffee/main/subscription-dashboard.coffee @@ -1,12 +1,18 @@ define [ "base" ], (App)-> + + App.controller 'SuccessfulSubscriptionController', ($scope, sixpack) -> + sixpack.convert 'plans-1610', () -> + + SUBSCRIPTION_URL = "/user/subscription/update" setupReturly = _.once -> recurly?.configure window.recurlyApiKey PRICES = {} + App.controller "CurrenyDropdownController", ($scope, MultiCurrencyPricing, $q)-> # $scope.plans = MultiCurrencyPricing.plans