Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plans: A/B test displaying features list vs. description in Plan v2 #3316

Merged
merged 5 commits into from
Feb 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 33 additions & 9 deletions client/components/plans/plan/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ var abtest = require( 'lib/abtest' ).abtest,
PlanPrice = require( 'components/plans/plan-price' ),
PlanDiscountMessage = require( 'components/plans/plan-discount-message' ),
Card = require( 'components/card' ),
WpcomPlanDetails = require( 'my-sites/plans/wpcom-plan-details' );
WpcomPlanDetails = require( 'my-sites/plans/wpcom-plan-details' ),
productsValues = require( 'lib/products-values' ),
isBusiness = productsValues.isBusiness;

module.exports = React.createClass( {
displayName: 'Plan',
Expand All @@ -40,8 +42,14 @@ module.exports = React.createClass( {
}
},

getComparePlansUrl: function() {
var site = this.props.site,
siteSuffix = site ? site.slug : '';

return this.props.comparePlansUrl ? this.props.comparePlansUrl : '/plans/compare/' + siteSuffix;
},

getDescription: function() {
var comparePlansUrl, siteSuffix;
const { plan, site } = this.props;

if ( this.isPlaceholder() ) {
Expand All @@ -54,9 +62,6 @@ module.exports = React.createClass( {
);
}

siteSuffix = site ? site.slug : '';
comparePlansUrl = this.props.comparePlansUrl ? this.props.comparePlansUrl : '/plans/compare/' + siteSuffix;

if ( site && site.jetpack ) {
return (
<JetpackPlanDetails plan={ plan } />
Expand All @@ -65,14 +70,15 @@ module.exports = React.createClass( {

return (
<WpcomPlanDetails
comparePlansUrl={ comparePlansUrl }
comparePlansUrl={ this.getComparePlansUrl() }
handleLearnMoreClick={ this.handleLearnMoreClick }
plan={ plan } />
);
},

getFeatureList: function() {
var features;
var features,
moreLink = '';

if ( this.isPlaceholder() ) {
return;
Expand All @@ -83,6 +89,10 @@ module.exports = React.createClass( {
'is-plan-specific': feature.planSpecific
} );

if ( abtest( 'plansFeatureList' ) === 'andMore' && feature.testVariable ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is testVariable a remnant of something else? It is slightly confusing to me to show the 'more link' based on a property on a specific feature (and the property appears on two features). It seems to me that we can get rid of it, and change the condition to show the 'more link' if:

  • the user is in the andMore test
  • the given plan is the business plan

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testVariable is still needed here to keep the feature from being shown in the main list, but you're right that we could check for the Business plan to set showMoreLink.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return null;
}

return (
<li className={ classes } key={ i }>
<Gridicon icon="checkmark" size={ 12 } />
Expand All @@ -91,7 +101,21 @@ module.exports = React.createClass( {
);
} );

return <ul className="plan__features">{ features }</ul>;
if ( abtest( 'plansFeatureList' ) === 'andMore' && isBusiness( this.props.plan ) ) {
moreLink = (
<li className="plan__feature is-plan-specific">
<Gridicon icon="checkmark" size={ 12 } />
<a href={ this.getComparePlansUrl() }>And more</a>
</li>
);
}

return (
<ul className="plan__features">
{ features }
{ moreLink }
</ul>
);
},

showDetails: function() {
Expand Down Expand Up @@ -226,7 +250,7 @@ module.exports = React.createClass( {
},

render: function() {
var shouldDisplayFeatureList = this.props.plan && ! isJetpackPlan( this.props.plan ) && abtest( 'plansFeatureList' ) === 'list';
var shouldDisplayFeatureList = this.props.plan && ! isJetpackPlan( this.props.plan ) && abtest( 'plansFeatureList' ) !== 'description';
return (
<Card className={ this.getClassNames() } key={ this.getProductSlug() } onClick={ this.showDetails }>
{ this.getPlanDiscountMessage() }
Expand Down
7 changes: 4 additions & 3 deletions client/lib/abtest/active-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ module.exports = {
defaultVariation: 'original'
},
plansFeatureList: {
datestamp: '20040202',
datestamp: '20160215',
variations: {
list: 50,
description: 50
list: 33,
andMore: 33,
description: 34
},
defaultVariation: 'description'
},
Expand Down
6 changes: 4 additions & 2 deletions client/lib/features-list/test-features.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,17 @@ const features = {
},
{
text: 'eCommerce',
planSpecific: true
planSpecific: true,
testVariable: true
},
{
text: 'Unlimited Premium Themes',
planSpecific: true
},
{
text: 'Google Analytics',
planSpecific: true
planSpecific: true,
testVariable: true
},
{
text: 'Live Chat Support',
Expand Down