From 75e570c07663336e282107173c12dc587b6f6d00 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Tue, 2 Sep 2014 11:07:21 +0100 Subject: [PATCH] fix ab cookies and send 0 event when clicking monthly free trial button on plans page --- services/web/public/coffee/analytics/AbTestingManager.coffee | 4 ++-- services/web/public/coffee/main/plans.coffee | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/services/web/public/coffee/analytics/AbTestingManager.coffee b/services/web/public/coffee/analytics/AbTestingManager.coffee index b2bc670256..70421a0eac 100644 --- a/services/web/public/coffee/analytics/AbTestingManager.coffee +++ b/services/web/public/coffee/analytics/AbTestingManager.coffee @@ -12,7 +12,7 @@ define [ return ipCookie(cookieKey) _persistCookieStep = (testName, bucket, newStep)-> - ipCookie(_buildCookieKey(testName, bucket), {step:newStep}, {expires:100}) + ipCookie(_buildCookieKey(testName, bucket), {step:newStep}, {expires:100, path:"/"}) ga('send', 'event', 'ab_tests', "#{testName}:#{bucket}", "step-#{newStep}") _checkIfStepIsNext = (cookieStep, newStep)-> @@ -30,7 +30,7 @@ define [ user_uuid = ipCookie(sl_user_test_token) if !user_uuid? user_uuid = Math.random() - ipCookie(sl_user_test_token, user_uuid, {expires:365}) + ipCookie(sl_user_test_token, user_uuid, {expires:365, path:"/"}) hash = CryptoJS.MD5("#{user_uuid}:#{testName}") return hash diff --git a/services/web/public/coffee/main/plans.coffee b/services/web/public/coffee/main/plans.coffee index 84d291baaf..4bb38e629b 100644 --- a/services/web/public/coffee/main/plans.coffee +++ b/services/web/public/coffee/main/plans.coffee @@ -19,6 +19,8 @@ define [ $scope.signUpNowClicked = (plan, annual)-> if $scope.ui.view == "annual" plan = "#{plan}_annual" + else + abTestManager.processTestWithStep("trial_len", bucket.bucketName, 0) event_tracking.send 'subscription-funnel', 'sign_up_now_button', plan $scope.switchToMonthly = ->