Fix participate/convert flow for plan tests

This commit is contained in:
Shane Kilkelly 2016-10-25 10:47:14 +01:00
parent c091399610
commit e268275e77
5 changed files with 20 additions and 17 deletions

View file

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

View file

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

View file

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

View file

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

View file

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