setup second plans page with free trial using google analytics experiements

This commit is contained in:
Henry Oswald 2014-03-21 17:49:20 +00:00
parent 63a5f2bf44
commit 4988fc4136
8 changed files with 218 additions and 17 deletions

View file

@ -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 = '''
<!-- Google Analytics Content Experiment code -->
<script>function utmx_section(){}function utmx(){}(function(){var
k='51652689-0',d=document,l=d.location,c=d.cookie;
if(l.search.indexOf('utm_expid='+k)>0)return;
function f(n){if(c){var i=c.indexOf(n+'=');if(i>-1){var j=c.
indexOf(';',i);return escape(c.substring(i+n.length+1,j<0?c.
length:j))}}}var x=f('__utmx'),xx=f('__utmxx'),h=l.hash;d.write(
'<sc'+'ript src="'+'http'+(l.protocol=='https:'?'s://ssl':
'://www')+'.google-analytics.com/ga_exp.js?'+'utmxkey='+k+
'&utmx='+(x?x:'')+'&utmxx='+(xx?xx:'')+'&utmxtime='+new Date().
valueOf()+(h?'&utmxhash='+escape(h.substr(1)):'')+
'" type="text/javascript" charset="utf-8"><\/sc'+'ript>')})();
</script><script>utmx('url','A/B');</script>
<!-- End of Google Analytics Content Experiment code -->
'''

View file

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

View file

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

View file

@ -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 <strong>30 day</strong> 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 <strong>30 day</strong> 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 <strong>30 day</strong> 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'))

View file

@ -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;")

View file

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

View file

@ -3,6 +3,7 @@ require [
"./forms"
"./gui"
"./home"
"./event_tracking"
], ()->

View file

@ -78,3 +78,6 @@
}
}
.freeTrialBlurb {
padding-left: 40px;
}