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