mirror of
https://github.com/overleaf/overleaf.git
synced 2024-09-16 02:52:31 -04:00
Fix participate/convert flow for plan tests
This commit is contained in:
parent
c091399610
commit
e268275e77
5 changed files with 20 additions and 17 deletions
|
@ -2,7 +2,7 @@ extends ../layout
|
||||||
|
|
||||||
block content
|
block content
|
||||||
.content.content-alt
|
.content.content-alt
|
||||||
.container
|
.container(ng-controller="SuccessfulSubscriptionController")
|
||||||
.row
|
.row
|
||||||
.col-md-8.col-md-offset-2
|
.col-md-8.col-md-offset-2
|
||||||
.card(ng-cloak)
|
.card(ng-cloak)
|
||||||
|
|
|
@ -68,22 +68,15 @@ define [
|
||||||
$scope.user = window.user
|
$scope.user = window.user
|
||||||
|
|
||||||
|
|
||||||
$scope.startTrialPlanCode = 'collaborator_free_trial_7_days'
|
|
||||||
$scope.shouldABTestPlans = false
|
$scope.shouldABTestPlans = false
|
||||||
$scope._plansVariant = 'default'
|
|
||||||
if $scope.user.signUpDate >= '2011-10-18'
|
if $scope.user.signUpDate >= '2011-10-18'
|
||||||
$scope.shouldABTestPlans = true
|
$scope.shouldABTestPlans = true
|
||||||
sixpack.participate 'plans-1610', ['default', 'heron', 'ibis'], (chosenVariation, rawResponse)->
|
|
||||||
$scope._plansVariant = chosenVariation
|
|
||||||
if chosenVariation in ['heron', 'ibis']
|
|
||||||
$scope.startTrialPlanCode = "collaborator_#{chosenVariation}"
|
|
||||||
|
|
||||||
$scope.settings = window.userSettings
|
$scope.settings = window.userSettings
|
||||||
$scope.anonymous = window.anonymous
|
$scope.anonymous = window.anonymous
|
||||||
|
|
||||||
$scope.chat = {}
|
$scope.chat = {}
|
||||||
|
|
||||||
|
|
||||||
# Only run the header AB test for newly registered users.
|
# Only run the header AB test for newly registered users.
|
||||||
_abTestStartDate = new Date(Date.UTC(2016, 8, 28))
|
_abTestStartDate = new Date(Date.UTC(2016, 8, 28))
|
||||||
_userSignUpDate = new Date(window.user.signUpDate)
|
_userSignUpDate = new Date(window.user.signUpDate)
|
||||||
|
|
|
@ -6,12 +6,18 @@ define [
|
||||||
$scope.buttonClass = "btn-primary"
|
$scope.buttonClass = "btn-primary"
|
||||||
|
|
||||||
$scope.startFreeTrial = (source, couponCode) ->
|
$scope.startFreeTrial = (source, couponCode) ->
|
||||||
event_tracking.sendMB "subscription-start-trial", { source, plan: $scope.startTrialPlanCode }
|
plan = 'collaborator_free_trial_7_days'
|
||||||
|
|
||||||
w = window.open()
|
w = window.open()
|
||||||
ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source)
|
sixpack.participate 'plans-1610', ['default', 'heron', 'ibis'], (chosenVariation, rawResponse)->
|
||||||
url = "/user/subscription/new?planCode=#{$scope.startTrialPlanCode}&ssp=true"
|
if $scope.shouldABTestPlans and chosenVariation in ['heron', 'ibis']
|
||||||
if couponCode?
|
plan = "collaborator_#{chosenVariation}"
|
||||||
url = "#{url}&cc=#{couponCode}"
|
|
||||||
$scope.startedFreeTrial = true
|
ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source)
|
||||||
w.location = url
|
url = "/user/subscription/new?planCode=#{plan}&ssp=true"
|
||||||
|
if couponCode?
|
||||||
|
url = "#{url}&cc=#{couponCode}"
|
||||||
|
|
||||||
|
$scope.startedFreeTrial = true
|
||||||
|
event_tracking.sendMB "subscription-start-trial", { source, plan}
|
||||||
|
w.location = url
|
||||||
|
|
|
@ -340,8 +340,6 @@ define [
|
||||||
|
|
||||||
$scope.signUpNowClicked = (plan, annual)->
|
$scope.signUpNowClicked = (plan, annual)->
|
||||||
event_tracking.sendMB 'plans-page-start-trial', {plan}
|
event_tracking.sendMB 'plans-page-start-trial', {plan}
|
||||||
if $scope.shouldABTestPlans and plan in ['student', 'collaborator']
|
|
||||||
sixpack.convert 'plans-1610', () ->
|
|
||||||
if $scope.ui.view == "annual"
|
if $scope.ui.view == "annual"
|
||||||
plan = "#{plan}_annual"
|
plan = "#{plan}_annual"
|
||||||
event_tracking.send 'subscription-funnel', 'sign_up_now_button', plan
|
event_tracking.send 'subscription-funnel', 'sign_up_now_button', plan
|
||||||
|
|
|
@ -1,12 +1,18 @@
|
||||||
define [
|
define [
|
||||||
"base"
|
"base"
|
||||||
], (App)->
|
], (App)->
|
||||||
|
|
||||||
|
App.controller 'SuccessfulSubscriptionController', ($scope, sixpack) ->
|
||||||
|
sixpack.convert 'plans-1610', () ->
|
||||||
|
|
||||||
|
|
||||||
SUBSCRIPTION_URL = "/user/subscription/update"
|
SUBSCRIPTION_URL = "/user/subscription/update"
|
||||||
|
|
||||||
setupReturly = _.once ->
|
setupReturly = _.once ->
|
||||||
recurly?.configure window.recurlyApiKey
|
recurly?.configure window.recurlyApiKey
|
||||||
PRICES = {}
|
PRICES = {}
|
||||||
|
|
||||||
|
|
||||||
App.controller "CurrenyDropdownController", ($scope, MultiCurrencyPricing, $q)->
|
App.controller "CurrenyDropdownController", ($scope, MultiCurrencyPricing, $q)->
|
||||||
|
|
||||||
# $scope.plans = MultiCurrencyPricing.plans
|
# $scope.plans = MultiCurrencyPricing.plans
|
||||||
|
|
Loading…
Reference in a new issue