Prechádzať zdrojové kódy

changed plan choice using ab sixpack not ga

Henry Oswald 11 rokov pred
rodič
commit
471b285ad7

+ 0 - 2
services/web/app/views/project/editor/track-changes.jade

@@ -34,7 +34,6 @@ div#trackChanges(ng-show="ui.view == 'track-changes'")
 						a.btn.btn-success(
 							href
 							ng-class="buttonClass"
-							sixpack-convert="track_changes_discount"
 							ng-click="startFreeTrial('track-changes')"
 						) #{translate("start_free_trial")}
 
@@ -78,7 +77,6 @@ div#trackChanges(ng-show="ui.view == 'track-changes'")
 					a.btn.btn-success(
 						href
 						ng-class="buttonClass"
-						sixpack-convert="track_changes_discount"
 						ng-click="startFreeTrial('track-changes', 'cf3yutfzu7ztxz')"
 					) #{translate("start_free_trial")}
 

+ 1 - 1
services/web/public/coffee/ide/track-changes/controllers/TrackChangesListController.coffee

@@ -8,7 +8,7 @@ define [
 				if $scope.project?.features?.versioning
 					$scope.versioningPopupType = "default"
 				else if $scope.ui.view == "track-changes"
-					sixpack.participate 'track_changes_discount', ['default', 'discount'], (chosenVariation, rawResponse)->
+					sixpack.participate 'track-changes-discount', ['default', 'discount'], (chosenVariation, rawResponse)->
 						$scope.versioningPopupType = chosenVariation
 
 	App.controller "TrackChangesListController", ["$scope", "ide", ($scope, ide) ->

+ 9 - 14
services/web/public/coffee/main/account-upgrade.coffee

@@ -1,22 +1,17 @@
 define [
 	"base"
 ], (App) ->
-	App.controller "FreeTrialModalController", ($scope, abTestManager)->
+	App.controller "FreeTrialModalController", ($scope, abTestManager, sixpack)->
 
 		$scope.buttonClass = "btn-primary"
 
 		$scope.startFreeTrial = (source, couponCode) ->
+			sixpack.convert "track-changes-discount", ->
 
-			testBuckets = [
-				{ bucketName:"student_control", planName:"student"}
-				{ bucketName:"collab_test", planName:"collaborator"}
-			]
-
-			editorPlanBucket = abTestManager.getABTestBucket "editor_plan", testBuckets
-			abTestManager.processTestWithStep("editor_plan", editorPlanBucket.bucketName, 0)
-			ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source)
-			url = "/user/subscription/new?planCode=#{editorPlanBucket.planName}_free_trial_7_days&ssp=#{editorPlanBucket.planName == 'collaborator'}"
-			if couponCode?
-				url = "#{url}&cc=#{couponCode}&scf=true"
-			window.open(url)
-			$scope.startedFreeTrial = true
+				sixpack.participate 'free-trial-plan', ['student', 'collaborator'], (planName, rawResponse)->
+					ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source)
+					url = "/user/subscription/new?planCode=#{planName}_free_trial_7_days&ssp=#{planName == 'collaborator'}"
+					if couponCode?
+						url = "#{url}&cc=#{couponCode}&scf=true"
+					window.open(url)
+					$scope.startedFreeTrial = true

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

@@ -2,7 +2,7 @@ define [
 	"base"
 ], (App)->
 
-	App.controller "NewSubscriptionController", ($scope, MultiCurrencyPricing, abTestManager, $http)->
+	App.controller "NewSubscriptionController", ($scope, MultiCurrencyPricing, abTestManager, $http, sixpack)->
 		throw new Error("Recurly API Library Missing.")  if typeof recurly is "undefined"
 	
 		$scope.currencyCode = MultiCurrencyPricing.currencyCode
@@ -108,7 +108,8 @@ define [
 						coupon_code:pricing.items?.coupon?.code || ""
 				$http.post("/user/subscription/create", postData)
 					.success (data, status, headers)->
-						window.location.href = "/user/subscription/thank-you"
+						sixpack.convert "free-trial-plan", pricing.items.plan.code, ->
+							window.location.href = "/user/subscription/thank-you"
 					.error (data, status, headers)->
 						$scope.processing = false
 						$scope.genericError = "Something went wrong processing the request"