mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
changed plan choice using ab sixpack not ga
This commit is contained in:
parent
9d3c49242d
commit
471b285ad7
4 changed files with 13 additions and 19 deletions
|
@ -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")}
|
||||
|
||||
|
|
|
@ -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) ->
|
||||
|
|
|
@ -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
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue