changed plan choice using ab sixpack not ga

This commit is contained in:
Henry Oswald 2015-11-16 16:40:14 +00:00
parent 9d3c49242d
commit 471b285ad7
4 changed files with 13 additions and 19 deletions

View file

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

View file

@ -8,7 +8,7 @@ define [
if $scope.project?.features?.versioning if $scope.project?.features?.versioning
$scope.versioningPopupType = "default" $scope.versioningPopupType = "default"
else if $scope.ui.view == "track-changes" 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 $scope.versioningPopupType = chosenVariation
App.controller "TrackChangesListController", ["$scope", "ide", ($scope, ide) -> App.controller "TrackChangesListController", ["$scope", "ide", ($scope, ide) ->

View file

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

View file

@ -2,7 +2,7 @@ define [
"base" "base"
], (App)-> ], (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" throw new Error("Recurly API Library Missing.") if typeof recurly is "undefined"
$scope.currencyCode = MultiCurrencyPricing.currencyCode $scope.currencyCode = MultiCurrencyPricing.currencyCode
@ -108,7 +108,8 @@ define [
coupon_code:pricing.items?.coupon?.code || "" coupon_code:pricing.items?.coupon?.code || ""
$http.post("/user/subscription/create", postData) $http.post("/user/subscription/create", postData)
.success (data, status, headers)-> .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)-> .error (data, status, headers)->
$scope.processing = false $scope.processing = false
$scope.genericError = "Something went wrong processing the request" $scope.genericError = "Something went wrong processing the request"