From ae2d030a32a755dd6e921fb571723983c65da498 Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Tue, 25 Oct 2016 11:46:52 +0100 Subject: [PATCH] Don't call participate if should not test plans --- .../web/public/coffee/main/account-upgrade.coffee | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/services/web/public/coffee/main/account-upgrade.coffee b/services/web/public/coffee/main/account-upgrade.coffee index 0da68fddfb..f2c9ac21a0 100644 --- a/services/web/public/coffee/main/account-upgrade.coffee +++ b/services/web/public/coffee/main/account-upgrade.coffee @@ -9,15 +9,19 @@ define [ 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}" - + go = () -> ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source) 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 + + if $scope.shouldABTestPlans + sixpack.participate 'plans-1610', ['default', 'heron', 'ibis'], (chosenVariation, rawResponse)-> + if chosenVariation in ['heron', 'ibis'] + plan = "collaborator_#{chosenVariation}" + go() + else + go()