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(
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")}

View file

@ -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) ->

View file

@ -1,21 +1,16 @@
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)
sixpack.participate 'free-trial-plan', ['student', 'collaborator'], (planName, rawResponse)->
ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source)
url = "/user/subscription/new?planCode=#{editorPlanBucket.planName}_free_trial_7_days&ssp=#{editorPlanBucket.planName == 'collaborator'}"
url = "/user/subscription/new?planCode=#{planName}_free_trial_7_days&ssp=#{planName == 'collaborator'}"
if couponCode?
url = "#{url}&cc=#{couponCode}&scf=true"
window.open(url)

View file

@ -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,6 +108,7 @@ define [
coupon_code:pricing.items?.coupon?.code || ""
$http.post("/user/subscription/create", postData)
.success (data, status, headers)->
sixpack.convert "free-trial-plan", pricing.items.plan.code, ->
window.location.href = "/user/subscription/thank-you"
.error (data, status, headers)->
$scope.processing = false