mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
added ab test in for multi currency
This commit is contained in:
parent
af769c7871
commit
750b050358
6 changed files with 56 additions and 16 deletions
|
@ -13,7 +13,6 @@ block content
|
||||||
.content.content-alt
|
.content.content-alt
|
||||||
.container(ng-controller="NewSubscriptionController" ng-cloak)
|
.container(ng-controller="NewSubscriptionController" ng-cloak)
|
||||||
.row.card-group
|
.row.card-group
|
||||||
|
|
||||||
.col-md-6.col-md-push-3
|
.col-md-6.col-md-push-3
|
||||||
.card.card-highlighted
|
.card.card-highlighted
|
||||||
.page-header
|
.page-header
|
||||||
|
@ -82,5 +81,11 @@ block content
|
||||||
|
|
||||||
window.ab = [
|
window.ab = [
|
||||||
{step:1, bucket:"14d", testName:"trial_len"},
|
{step:1, bucket:"14d", testName:"trial_len"},
|
||||||
{step:1, bucket:"7d", testName:"trial_len"}
|
{step:1, bucket:"7d", testName:"trial_len"},
|
||||||
|
|
||||||
|
{step:1, bucket:"eu-eu", testName:"multi_currency"},
|
||||||
|
{step:1, bucket:"eu-usd", testName:"multi_currency"}
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ extends ../layout
|
||||||
block scripts
|
block scripts
|
||||||
script(type='text/javascript').
|
script(type='text/javascript').
|
||||||
window.recomendedCurrency = '#{recomendedCurrency}'
|
window.recomendedCurrency = '#{recomendedCurrency}'
|
||||||
|
window.abCurrencyFlag = '#{abCurrencyFlag}'
|
||||||
block content
|
block content
|
||||||
.content-alt
|
.content-alt
|
||||||
.content.plans(ng-controller="PlansController")
|
.content.plans(ng-controller="PlansController")
|
||||||
|
|
|
@ -36,5 +36,12 @@ block content
|
||||||
script(type="text/javascript").
|
script(type="text/javascript").
|
||||||
window.ab = [
|
window.ab = [
|
||||||
{step:2, bucket:"14d", testName:"trial_len"},
|
{step:2, bucket:"14d", testName:"trial_len"},
|
||||||
{step:2, bucket:"7d", testName:"trial_len"}
|
{step:2, bucket:"7d", testName:"trial_len"},
|
||||||
|
{step:2, bucket:"eu-eu", testName:"multi_currency"},
|
||||||
|
{step:2, bucket:"eu-usd", testName:"multi_currency"},
|
||||||
|
|
||||||
|
{step:1, bucket:"eu-eu", testName:"multi_currency_editor"},
|
||||||
|
{step:1, bucket:"eu-usd", testName:"multi_currency_editor"}
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
|
@ -35,7 +35,7 @@ define [
|
||||||
return false
|
return false
|
||||||
|
|
||||||
_getUsersHash = (testName)->
|
_getUsersHash = (testName)->
|
||||||
sl_user_test_token = "sl_utt"
|
sl_user_test_token = "sl_utt_#{testName}"
|
||||||
user_uuid = ipCookie(sl_user_test_token)
|
user_uuid = ipCookie(sl_user_test_token)
|
||||||
if !user_uuid?
|
if !user_uuid?
|
||||||
user_uuid = Math.random()
|
user_uuid = Math.random()
|
||||||
|
|
|
@ -2,11 +2,21 @@ define [
|
||||||
"base"
|
"base"
|
||||||
], (App)->
|
], (App)->
|
||||||
|
|
||||||
App.controller "NewSubscriptionController", ($scope, MultiCurrencyPricing)->
|
App.controller "NewSubscriptionController", ($scope, MultiCurrencyPricing, abTestManager)->
|
||||||
|
|
||||||
|
|
||||||
$scope.currencyCode = MultiCurrencyPricing.currencyCode
|
$scope.currencyCode = MultiCurrencyPricing.currencyCode
|
||||||
$scope.plans = MultiCurrencyPricing.plans
|
$scope.plans = MultiCurrencyPricing.plans
|
||||||
|
|
||||||
|
|
||||||
|
if MultiCurrencyPricing.currencyCode != "USD"
|
||||||
|
currencyBuckets = [
|
||||||
|
{ bucketName:"eu-eu", currency:MultiCurrencyPricing.currencyCode}
|
||||||
|
{ bucketName:"eu-usd", currency:"USD"}
|
||||||
|
]
|
||||||
|
multiCurrencyBucket = abTestManager.getABTestBucket "multi_currency", currencyBuckets
|
||||||
|
$scope.currencyCode = multiCurrencyBucket.currency
|
||||||
|
abTestManager.processTestWithStep("multi_currency_editor", multiCurrencyBucket.bucketName, 0)
|
||||||
|
|
||||||
|
|
||||||
$scope.changeCurrency = (newCurrency)->
|
$scope.changeCurrency = (newCurrency)->
|
||||||
window.location = "/user/subscription/new?planCode=#{window.plan_code}¤cy=#{newCurrency}"
|
window.location = "/user/subscription/new?planCode=#{window.plan_code}¤cy=#{newCurrency}"
|
|
@ -29,11 +29,11 @@ define [
|
||||||
monthly: "€7"
|
monthly: "€7"
|
||||||
annual: "€70"
|
annual: "€70"
|
||||||
collaborator:
|
collaborator:
|
||||||
monthly: "€12"
|
monthly: "€14"
|
||||||
annual: "€144"
|
annual: "€168"
|
||||||
professional:
|
professional:
|
||||||
monthly: "€25"
|
monthly: "€28"
|
||||||
annual: "€300"
|
annual: "€336"
|
||||||
|
|
||||||
GBP:
|
GBP:
|
||||||
symbol: "£"
|
symbol: "£"
|
||||||
|
@ -41,11 +41,11 @@ define [
|
||||||
monthly: "£6"
|
monthly: "£6"
|
||||||
annual: "£60"
|
annual: "£60"
|
||||||
collaborator:
|
collaborator:
|
||||||
monthly: "£10"
|
monthly: "£12"
|
||||||
annual: "£120"
|
annual: "£144"
|
||||||
professional:
|
professional:
|
||||||
monthly: "£22"
|
monthly: "£24"
|
||||||
annual: "£264"
|
annual: "£288"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -53,10 +53,25 @@ define [
|
||||||
|
|
||||||
App.controller "PlansController", ($scope, $modal, event_tracking, abTestManager, MultiCurrencyPricing, $http) ->
|
App.controller "PlansController", ($scope, $modal, event_tracking, abTestManager, MultiCurrencyPricing, $http) ->
|
||||||
|
|
||||||
|
|
||||||
|
$scope.plans = MultiCurrencyPricing.plans
|
||||||
|
$scope.currencyCode = MultiCurrencyPricing.currencyCode
|
||||||
|
|
||||||
|
|
||||||
buckets = [
|
buckets = [
|
||||||
{ bucketName:"7d", queryString: "_free_trial_7_days", trial_len:7 }
|
{ bucketName:"7d", queryString: "_free_trial_7_days", trial_len:7 }
|
||||||
{ bucketName:"14d", queryString: "_free_trial_14_days", trial_len:14 }
|
{ bucketName:"14d", queryString: "_free_trial_14_days", trial_len:14 }
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if MultiCurrencyPricing.currencyCode != "USD"
|
||||||
|
currencyBuckets = [
|
||||||
|
{ bucketName:"eu-eu", currency:MultiCurrencyPricing.currencyCode}
|
||||||
|
{ bucketName:"eu-usd", currency:"USD"}
|
||||||
|
]
|
||||||
|
multiCurrencyBucket = abTestManager.getABTestBucket "multi_currency", currencyBuckets
|
||||||
|
$scope.currencyCode = multiCurrencyBucket.currency
|
||||||
|
|
||||||
|
|
||||||
bucket = abTestManager.getABTestBucket "trial_len", buckets
|
bucket = abTestManager.getABTestBucket "trial_len", buckets
|
||||||
|
|
||||||
$scope.trial_len = bucket.trial_len
|
$scope.trial_len = bucket.trial_len
|
||||||
|
@ -65,13 +80,15 @@ define [
|
||||||
$scope.ui =
|
$scope.ui =
|
||||||
view: "monthly"
|
view: "monthly"
|
||||||
|
|
||||||
$scope.plans = MultiCurrencyPricing.plans
|
|
||||||
$scope.currencyCode = MultiCurrencyPricing.currencyCode
|
|
||||||
|
|
||||||
$scope.changeCurreny = (newCurrency)->
|
$scope.changeCurreny = (newCurrency)->
|
||||||
$scope.currencyCode = newCurrency
|
$scope.currencyCode = newCurrency
|
||||||
|
|
||||||
$scope.signUpNowClicked = (plan, annual)->
|
$scope.signUpNowClicked = (plan, annual)->
|
||||||
|
if multiCurrencyBucket?
|
||||||
|
abTestManager.processTestWithStep("multi_currency", multiCurrencyBucket.bucketName, 0)
|
||||||
|
|
||||||
if $scope.ui.view == "annual"
|
if $scope.ui.view == "annual"
|
||||||
plan = "#{plan}_annual"
|
plan = "#{plan}_annual"
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue