fix ab cookies and send 0 event when clicking monthly free trial button on plans page

This commit is contained in:
Henry Oswald 2014-09-02 11:07:21 +01:00
parent c4a379075d
commit 75e570c076
2 changed files with 4 additions and 2 deletions

View file

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

View file

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