mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-06 08:14:25 +00: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
|
||||
.content.content-alt
|
||||
.container
|
||||
.container(ng-controller="SuccessfulSubscriptionController")
|
||||
.row
|
||||
.col-md-8.col-md-offset-2
|
||||
.card(ng-cloak)
|
||||
|
|
|
@ -68,22 +68,15 @@ define [
|
|||
$scope.user = window.user
|
||||
|
||||
|
||||
$scope.startTrialPlanCode = 'collaborator_free_trial_7_days'
|
||||
$scope.shouldABTestPlans = false
|
||||
$scope._plansVariant = 'default'
|
||||
if $scope.user.signUpDate >= '2011-10-18'
|
||||
$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.anonymous = window.anonymous
|
||||
|
||||
$scope.chat = {}
|
||||
|
||||
|
||||
# Only run the header AB test for newly registered users.
|
||||
_abTestStartDate = new Date(Date.UTC(2016, 8, 28))
|
||||
_userSignUpDate = new Date(window.user.signUpDate)
|
||||
|
|
|
@ -6,12 +6,18 @@ define [
|
|||
$scope.buttonClass = "btn-primary"
|
||||
|
||||
$scope.startFreeTrial = (source, couponCode) ->
|
||||
event_tracking.sendMB "subscription-start-trial", { source, plan: $scope.startTrialPlanCode }
|
||||
plan = 'collaborator_free_trial_7_days'
|
||||
|
||||
w = window.open()
|
||||
sixpack.participate 'plans-1610', ['default', 'heron', 'ibis'], (chosenVariation, rawResponse)->
|
||||
if $scope.shouldABTestPlans and chosenVariation in ['heron', 'ibis']
|
||||
plan = "collaborator_#{chosenVariation}"
|
||||
|
||||
ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source)
|
||||
url = "/user/subscription/new?planCode=#{$scope.startTrialPlanCode}&ssp=true"
|
||||
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)->
|
||||
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"
|
||||
plan = "#{plan}_annual"
|
||||
event_tracking.send 'subscription-funnel', 'sign_up_now_button', plan
|
||||
|
|
|
@ -1,12 +1,18 @@
|
|||
define [
|
||||
"base"
|
||||
], (App)->
|
||||
|
||||
App.controller 'SuccessfulSubscriptionController', ($scope, sixpack) ->
|
||||
sixpack.convert 'plans-1610', () ->
|
||||
|
||||
|
||||
SUBSCRIPTION_URL = "/user/subscription/update"
|
||||
|
||||
setupReturly = _.once ->
|
||||
recurly?.configure window.recurlyApiKey
|
||||
PRICES = {}
|
||||
|
||||
|
||||
App.controller "CurrenyDropdownController", ($scope, MultiCurrencyPricing, $q)->
|
||||
|
||||
# $scope.plans = MultiCurrencyPricing.plans
|
||||
|
|
Loading…
Reference in a new issue