From 4988fc4136eee2568ba999b01f06f341e2f580a2 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Fri, 21 Mar 2014 17:49:20 +0000 Subject: [PATCH] setup second plans page with free trial using google analytics experiements --- .../SubscriptionController.coffee | 21 ++- .../SubscriptionViewModelBuilder.coffee | 7 +- services/web/app/views/layout.jade | 3 + .../views/subscriptions/plans-freetrial.jade | 168 ++++++++++++++++++ .../web/app/views/subscriptions/plans.jade | 14 +- .../web/public/coffee/event_tracking.coffee | 18 +- services/web/public/coffee/main.coffee | 1 + .../stylesheets/less/subscriptions.less | 3 + 8 files changed, 218 insertions(+), 17 deletions(-) create mode 100644 services/web/app/views/subscriptions/plans-freetrial.jade diff --git a/services/web/app/coffee/Features/Subscription/SubscriptionController.coffee b/services/web/app/coffee/Features/Subscription/SubscriptionController.coffee index e7a67a877e..ce9e47764a 100644 --- a/services/web/app/coffee/Features/Subscription/SubscriptionController.coffee +++ b/services/web/app/coffee/Features/Subscription/SubscriptionController.coffee @@ -19,11 +19,12 @@ module.exports = SubscriptionController = plan.href = "/register?redir=#{plan.href}" viewName = "subscriptions/plans" if req.query.variant? - viewName += req.query.variant + viewName += "-#{req.query.variant}" logger.log viewName:viewName, "showing plans page" res.render viewName, title: "Plans and Pricing" plans: plans + gaExperimentCode: gaExperimentCode #get to show the recurly.js page @@ -167,3 +168,21 @@ module.exports = SubscriptionController = return next(error) if error? req.body = body next() + + +gaExperimentCode = ''' + + + +''' \ No newline at end of file diff --git a/services/web/app/coffee/Features/Subscription/SubscriptionViewModelBuilder.coffee b/services/web/app/coffee/Features/Subscription/SubscriptionViewModelBuilder.coffee index bb2bfa5e6b..340863a405 100644 --- a/services/web/app/coffee/Features/Subscription/SubscriptionViewModelBuilder.coffee +++ b/services/web/app/coffee/Features/Subscription/SubscriptionViewModelBuilder.coffee @@ -38,8 +38,13 @@ module.exports = buildViewModel : -> plans = Settings.plans + allPlans = {} + plans.forEach (plan)-> + allPlans[plan.planCode] = plan + result = - allPlans: plans + allPlans: allPlans + result.personalAccount = _.find plans, (plan)-> plan.planCode == "personal" diff --git a/services/web/app/views/layout.jade b/services/web/app/views/layout.jade index 396d8a4cb1..3f62ccceb6 100644 --- a/services/web/app/views/layout.jade +++ b/services/web/app/views/layout.jade @@ -1,6 +1,9 @@ !!! html(itemscope, itemtype='http://schema.org/Product') head + if (typeof(gaExperimentCode) !== "undefined" && gaExperimentCode) + !{gaExperimentCode} + - if (typeof(priority_title) !== "undefined" && priority_title) title= title + ' - Online LaTeX Editor ShareLaTeX' - else diff --git a/services/web/app/views/subscriptions/plans-freetrial.jade b/services/web/app/views/subscriptions/plans-freetrial.jade new file mode 100644 index 0000000000..b4a5a4f01f --- /dev/null +++ b/services/web/app/views/subscriptions/plans-freetrial.jade @@ -0,0 +1,168 @@ +extends ../layout + +mixin liSection(feature) + | #{feature.text} + -if(feature.comingSoon) + span.label.label-info coming soon + -if(feature.beta) + span.label.label-warning beta + + +mixin plan(plan, cssClass, monthly) + .pricing-table + ul(class=cssClass) + + li.pricing-header-row-1 + .package-title + h2.no-bold #{plan.name} + + li.pricing-header-row-2 + .package-price + if plan.price == 0 + h1.free Free forever + else + h1.no-bold + | $#{plan.price/100} + if monthly + span.cents /month + else + span.cents /year + + - var odd = false + - if(plan.planCode != "personal") + li.pricing-content-row-even + mixin liSection({text:"30 day free trial"}) + -each feature in plan.featureDescription + - odd = !odd + - if(odd) + li.pricing-content-row-odd + mixin liSection(feature) + - else + li.pricing-content-row-even + mixin liSection(feature) + - if(plan.planCode == "personal") + li.pricing-content-row-even + mixin liSection({text:""}) + + + li.pricing-footer + - var href = '/user/subscription/new?planCode='+plan.planCode + + - planIsPersonal = plan.planCode.indexOf("personal") != -1 + - userNotLoggedIn = session && !session.user + -if(planIsPersonal) + - href = "/register" + -else if(userNotLoggedIn) + - href = "/register?redir="+href + a.btn.btn-success(href='#{href}').sign_up_now + | Sign Up Now! + + +block content + .container + .row + .span12.span-box + .page-header + h1 Choose your plan + blockquote.quote.pull-right + p + | This is one of the most useful resources I have ever found on the Internet. + br + | Fantastic execution and thoughtful attention to detail make this product shine! + small Benjamin Shepherd, Waterloo University + + .row + .span12 + .offset3 + ul.nav.nav-pills.pricing-pills + li.active + a(href="#", data-target=".monthly-pricing", data-toggle="tab") Monthly + li + a(href="#", data-target=".annual-pricing", data-toggle="tab") Annual + li + a(href="#", data-target=".student-pricing", data-toggle="tab") Half price student plans + + .row + .span12 + .page-header + h2 Individual Plans + + .pricing-steelblue.pricing-row + .tab-content + .tab-pane.active.monthly-pricing + .row + .span6.offset3.tagline.freeTrialBlurb + h1 Start your risk free 30 day trial + .row + .span4 + mixin plan(plans.personalAccount, "", true) + .span4 + mixin plan(plans.allPlans['collaborator_free_trial'], "big", true) + .span4 + mixin plan(plans.allPlans['professional_free_trial'], "", true) + + .tab-pane.annual-pricing + .row + .span6.offset3.tagline.freeTrialBlurb + h1 Start your risk free 30 day trial + .span4 + mixin plan(plans.personalAccount, "", true) + .span4 + mixin plan(plans.allPlans['collaborator-annual_free_trial'], "big", false) + .span4 + mixin plan(plans.allPlans['prof-ann_free_trial'], "", false) + + .tab-pane.student-pricing + .row + .span6.offset3.tagline.freeTrialBlurb + h1 Start your risk free 30 day trial + .span4 + mixin plan(plans.personalAccount, "", true) + .span4 + mixin plan(plans.allPlans['student_free_trial'], "big", true) + .span4 + mixin plan(plans.allPlans['stud-ann_free_trial'], "", false) + + .pricing-steelblue.pricing-row + .tab-content + .tab-pane.active.monthly-pricing + .page-header + h2 Group Plans + .row + .span12.tagline + p Improve the workflow of your research group by unlocking ShareLaTeX's premium features for everyone on your team + .row + .span4 + mixin plan(plans.groupMonthlyPlans[0], "", true) + .span4 + mixin plan(plans.groupMonthlyPlans[1], "big", true) + .span4 + mixin plan(plans.groupMonthlyPlans[2], "", true) + .tab-pane.annual-pricing + .page-header + h2 Group Plans + .row + .span12.tagline + p Improve the workflow of your research group by unlocking ShareLaTeX's premium features for everyone on your team + .row + .span4 + mixin plan(plans.groupAnnualPlans[0], "", false) + .span4 + mixin plan(plans.groupAnnualPlans[1], "big", false) + .span4 + mixin plan(plans.groupAnnualPlans[2], "", false) + .tab-pane.student-pricing + + + .row + .span6.offset3 + .alert.alert-info(style="color: #333") + h3 Want to use ShareLaTeX for free? + p Tell your university or department about our + a(href="/university") site licenses + | and use of all our + | features for free as a student or member of staff. + + include ../general/small-footer + link(rel='stylesheet', href='/brand/plans.css?fingerprint='+fingerprint('/brand/plans.css')) + diff --git a/services/web/app/views/subscriptions/plans.jade b/services/web/app/views/subscriptions/plans.jade index b00e136ff4..892796d776 100644 --- a/services/web/app/views/subscriptions/plans.jade +++ b/services/web/app/views/subscriptions/plans.jade @@ -47,7 +47,7 @@ mixin plan(plan, cssClass, monthly) - href = "/register" -else if(userNotLoggedIn) - href = "/register?redir="+href - a.btn.btn-success(href='#{href}').sign_up_now + a.btn.btn-success(href='#{href}', ga_PlanType=plan.planCode).sign_up_now | Sign Up Now! @@ -90,9 +90,9 @@ block content .span4 mixin plan(plans.personalAccount, "", true) .span4 - mixin plan(plans.individualMonthlyPlans[0], "big", true) + mixin plan(plans.allPlans['collaborator'], "big", true) .span4 - mixin plan(plans.individualMonthlyPlans[1], "", true) + mixin plan(plans.allPlans['professional'], "", true) .tab-pane.annual-pricing .row @@ -101,9 +101,9 @@ block content .span4 mixin plan(plans.personalAccount, "", true) .span4 - mixin plan(plans.individualAnnualPlans[0], "big", false) + mixin plan(plans.allPlans['collaborator-annual'], "big", false) .span4 - mixin plan(plans.individualAnnualPlans[1], "", false) + mixin plan(plans.allPlans['professional-annual'], "", false) .tab-pane.student-pricing .row @@ -112,9 +112,9 @@ block content .span4 mixin plan(plans.personalAccount, "", true) .span4 - mixin plan(plans.studentAccounts[0], "big", true) + mixin plan(plans.allPlans['student'], "big", true) .span4 - mixin plan(plans.studentAccounts[1], "", false) + mixin plan(plans.allPlans['student-annual'], "", false) .row .span12.ab-guarantee-shown(style="text-align: center;") diff --git a/services/web/public/coffee/event_tracking.coffee b/services/web/public/coffee/event_tracking.coffee index e369f92c8f..84d1219ae5 100644 --- a/services/web/public/coffee/event_tracking.coffee +++ b/services/web/public/coffee/event_tracking.coffee @@ -1,15 +1,17 @@ require [ - "libs/bootstrap/bootstrap2full" ], ()-> #plans page - $('a.sign_up_now').on 'click', -> - ga 'send', 'event', 'button', 'click', 'premium-sign-up' + $('a.sign_up_now').on 'click', (e)-> + ga_PlanType = $(@).attr("ga_PlanType") + ga 'send', 'event', 'subscription-funnel', 'sign_up_now_button', ga_PlanType + $('#annual-pricing').on 'click', -> - ga 'send', 'event', 'button', 'click', 'student-prices' - + ga 'send', 'event', 'subscription-funnel', 'plans-page', 'annual-prices' $('#student-pricing').on 'click', -> - ga('send', 'event', 'button', 'click', 'student-prices') + ga('send', 'event', 'subscription-funnel', 'plans-page', 'student-prices') - #plans link $('#plansLink').on 'click', -> - ga 'send', 'event', 'button', 'click', 'plans-link-menu-bar' + ga 'send', 'event', 'subscription-funnel', 'go-to-plans-page', 'from menu bar' + + + diff --git a/services/web/public/coffee/main.coffee b/services/web/public/coffee/main.coffee index 80310702ae..8030aca98d 100644 --- a/services/web/public/coffee/main.coffee +++ b/services/web/public/coffee/main.coffee @@ -3,6 +3,7 @@ require [ "./forms" "./gui" "./home" + "./event_tracking" ], ()-> diff --git a/services/web/public/stylesheets/less/subscriptions.less b/services/web/public/stylesheets/less/subscriptions.less index d279dce345..2972e6f6e1 100644 --- a/services/web/public/stylesheets/less/subscriptions.less +++ b/services/web/public/stylesheets/less/subscriptions.less @@ -78,3 +78,6 @@ } } +.freeTrialBlurb { + padding-left: 40px; +}