Procházet zdrojové kódy

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

Henry Oswald před 12 roky
rodič
revize
75e570c076

+ 2 - 2
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
 

+ 2 - 0
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 = ->