Просмотр исходного кода

added ab test in for multi currency

Henry Oswald 12 лет назад
Родитель
Сommit
750b050358

+ 7 - 2
services/web/app/views/subscriptions/new.jade

@@ -13,7 +13,6 @@ block content
 	.content.content-alt
 		.container(ng-controller="NewSubscriptionController" ng-cloak)
 			.row.card-group
-						
 				.col-md-6.col-md-push-3
 					.card.card-highlighted
 						.page-header
@@ -82,5 +81,11 @@ block content
 
 		window.ab = [
 			{step:1, bucket:"14d", testName:"trial_len"},
-			{step:1, bucket:"7d", testName:"trial_len"}
+			{step:1, bucket:"7d", testName:"trial_len"},
+
+			{step:1, bucket:"eu-eu", testName:"multi_currency"},
+			{step:1, bucket:"eu-usd", testName:"multi_currency"}
+
+
 		]
+

+ 1 - 0
services/web/app/views/subscriptions/plans.jade

@@ -2,6 +2,7 @@ extends ../layout
 block scripts
 	script(type='text/javascript').
 		window.recomendedCurrency = '#{recomendedCurrency}'
+		window.abCurrencyFlag = '#{abCurrencyFlag}'
 block content
 	.content-alt
 		.content.plans(ng-controller="PlansController")

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

@@ -36,5 +36,12 @@ block content
 	script(type="text/javascript").
 		window.ab = [
 			{step:2, bucket:"14d", testName:"trial_len"},
-			{step:2, bucket:"7d", testName:"trial_len"}
+			{step:2, bucket:"7d", testName:"trial_len"},
+			{step:2, bucket:"eu-eu", testName:"multi_currency"},
+			{step:2, bucket:"eu-usd", testName:"multi_currency"},
+
+			{step:1, bucket:"eu-eu", testName:"multi_currency_editor"},
+			{step:1, bucket:"eu-usd", testName:"multi_currency_editor"}
+
+
 		]

+ 1 - 1
services/web/public/coffee/analytics/AbTestingManager.coffee

@@ -35,7 +35,7 @@ define [
 				return false
 
 		_getUsersHash = (testName)->
-			sl_user_test_token = "sl_utt"
+			sl_user_test_token = "sl_utt_#{testName}"
 			user_uuid = ipCookie(sl_user_test_token)
 			if !user_uuid?
 				user_uuid = Math.random()

+ 12 - 2
services/web/public/coffee/main/new-subscription.coffee

@@ -2,11 +2,21 @@ define [
 	"base"
 ], (App)->
 
-	App.controller "NewSubscriptionController", ($scope, MultiCurrencyPricing)->
-
+	App.controller "NewSubscriptionController", ($scope, MultiCurrencyPricing, abTestManager)->
 	
 		$scope.currencyCode = MultiCurrencyPricing.currencyCode
 		$scope.plans = MultiCurrencyPricing.plans
 
+
+		if MultiCurrencyPricing.currencyCode != "USD"
+			currencyBuckets = [
+				{ bucketName:"eu-eu", currency:MultiCurrencyPricing.currencyCode}
+				{ bucketName:"eu-usd", currency:"USD"}
+			]
+			multiCurrencyBucket = abTestManager.getABTestBucket "multi_currency", currencyBuckets
+			$scope.currencyCode = multiCurrencyBucket.currency
+			abTestManager.processTestWithStep("multi_currency_editor", multiCurrencyBucket.bucketName, 0)
+
+
 		$scope.changeCurrency = (newCurrency)->
 			window.location = "/user/subscription/new?planCode=#{window.plan_code}&currency=#{newCurrency}"

+ 27 - 10
services/web/public/coffee/main/plans.coffee

@@ -29,11 +29,11 @@ define [
 						monthly: "€7"
 						annual: "€70"
 					collaborator:
-						monthly: "€12"
-						annual: "€144"
+						monthly: "€14"
+						annual: "€168"
 					professional:
-						monthly: "€25"
-						annual: "€300"
+						monthly: "€28"
+						annual: "€336"
 						
 				GBP:
 					symbol: "£"
@@ -41,11 +41,11 @@ define [
 						monthly: "£6"
 						annual: "£60"
 					collaborator:
-						monthly: "£10"
-						annual: "£120"
+						monthly: "£12"
+						annual: "£144"
 					professional:
-						monthly: "£22"
-						annual: "£264"
+						monthly: "£24"
+						annual: "£288"
 		}
 	
 
@@ -53,10 +53,25 @@ define [
 
 	App.controller "PlansController", ($scope, $modal, event_tracking, abTestManager, MultiCurrencyPricing, $http) ->
 		
+
+		$scope.plans = MultiCurrencyPricing.plans
+		$scope.currencyCode = MultiCurrencyPricing.currencyCode
+
+
 		buckets = [
 			{ bucketName:"7d", queryString: "_free_trial_7_days", trial_len:7 }
 			{ bucketName:"14d", queryString: "_free_trial_14_days", trial_len:14 }
 		]
+
+		if MultiCurrencyPricing.currencyCode != "USD"
+			currencyBuckets = [
+				{ bucketName:"eu-eu", currency:MultiCurrencyPricing.currencyCode}
+				{ bucketName:"eu-usd", currency:"USD"}
+			]
+			multiCurrencyBucket = abTestManager.getABTestBucket "multi_currency", currencyBuckets
+			$scope.currencyCode = multiCurrencyBucket.currency
+
+
 		bucket = abTestManager.getABTestBucket "trial_len", buckets
 
 		$scope.trial_len = bucket.trial_len
@@ -65,13 +80,15 @@ define [
 		$scope.ui =
 			view: "monthly"
 
-		$scope.plans = MultiCurrencyPricing.plans
-		$scope.currencyCode = MultiCurrencyPricing.currencyCode
+
 
 		$scope.changeCurreny = (newCurrency)->
 			$scope.currencyCode = newCurrency
 
 		$scope.signUpNowClicked = (plan, annual)->
+			if multiCurrencyBucket?
+				abTestManager.processTestWithStep("multi_currency", multiCurrencyBucket.bucketName, 0)
+
 			if $scope.ui.view == "annual"
 				plan = "#{plan}_annual"
 			else