فهرست منبع

Fix participate/convert flow for plan tests

Shane Kilkelly 10 سال پیش
والد
کامیت
e268275e77

+ 1 - 1
services/web/app/views/subscriptions/successful_subscription.jade

@@ -2,7 +2,7 @@ extends ../layout
 
 
 block content
 block content
 	.content.content-alt
 	.content.content-alt
-		.container
+		.container(ng-controller="SuccessfulSubscriptionController")
 			.row
 			.row
 				.col-md-8.col-md-offset-2
 				.col-md-8.col-md-offset-2
 					.card(ng-cloak)
 					.card(ng-cloak)

+ 0 - 7
services/web/public/coffee/ide.coffee

@@ -68,22 +68,15 @@ define [
 		$scope.user = window.user
 		$scope.user = window.user
 
 
 
 
-		$scope.startTrialPlanCode = 'collaborator_free_trial_7_days'
 		$scope.shouldABTestPlans = false
 		$scope.shouldABTestPlans = false
-		$scope._plansVariant = 'default'
 		if $scope.user.signUpDate >= '2011-10-18'
 		if $scope.user.signUpDate >= '2011-10-18'
 			$scope.shouldABTestPlans = true
 			$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.settings = window.userSettings
 		$scope.anonymous = window.anonymous
 		$scope.anonymous = window.anonymous
 
 
 		$scope.chat = {}
 		$scope.chat = {}
 
 
-
 		# Only run the header AB test for newly registered users.
 		# Only run the header AB test for newly registered users.
 		_abTestStartDate = new Date(Date.UTC(2016, 8, 28))
 		_abTestStartDate = new Date(Date.UTC(2016, 8, 28))
 		_userSignUpDate = new Date(window.user.signUpDate)
 		_userSignUpDate = new Date(window.user.signUpDate)

+ 13 - 7
services/web/public/coffee/main/account-upgrade.coffee

@@ -6,12 +6,18 @@ define [
 		$scope.buttonClass = "btn-primary"
 		$scope.buttonClass = "btn-primary"
 
 
 		$scope.startFreeTrial = (source, couponCode) ->
 		$scope.startFreeTrial = (source, couponCode) ->
-			event_tracking.sendMB "subscription-start-trial", { source, plan: $scope.startTrialPlanCode }
+			plan = 'collaborator_free_trial_7_days'
 
 
 			w = window.open()
 			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

+ 0 - 2
services/web/public/coffee/main/plans.coffee

@@ -340,8 +340,6 @@ define [
 
 
 		$scope.signUpNowClicked = (plan, annual)->
 		$scope.signUpNowClicked = (plan, annual)->
 			event_tracking.sendMB 'plans-page-start-trial', {plan}
 			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"
 			if $scope.ui.view == "annual"
 				plan = "#{plan}_annual"
 				plan = "#{plan}_annual"
 			event_tracking.send   'subscription-funnel', 'sign_up_now_button', plan
 			event_tracking.send   'subscription-funnel', 'sign_up_now_button', plan

+ 6 - 0
services/web/public/coffee/main/subscription-dashboard.coffee

@@ -1,12 +1,18 @@
 define [
 define [
 	"base"
 	"base"
 ], (App)->
 ], (App)->
+
+	App.controller 'SuccessfulSubscriptionController', ($scope, sixpack) ->
+		sixpack.convert 'plans-1610', () ->
+
+
 	SUBSCRIPTION_URL = "/user/subscription/update"
 	SUBSCRIPTION_URL = "/user/subscription/update"
 
 
 	setupReturly = _.once ->
 	setupReturly = _.once ->
 		recurly?.configure window.recurlyApiKey
 		recurly?.configure window.recurlyApiKey
 	PRICES = {}
 	PRICES = {}
 
 
+
 	App.controller "CurrenyDropdownController", ($scope, MultiCurrencyPricing, $q)->
 	App.controller "CurrenyDropdownController", ($scope, MultiCurrencyPricing, $q)->
 
 
 		# $scope.plans = MultiCurrencyPricing.plans
 		# $scope.plans = MultiCurrencyPricing.plans