Merge pull request #4825 from overleaf/ab-cleanup-sub-page-split-test

Cleanup subscription page split test and set variant as new copy

GitOrigin-RevId: b7a19cf5f744d9181b71200351dc5a92db939e92
This commit is contained in:
Alexandre Bourdin 2021-08-31 14:45:53 +02:00 committed by Copybot
parent 2feea2592d
commit ffb30435d8
3 changed files with 8 additions and 47 deletions

View file

@ -14,14 +14,11 @@ const V1SubscriptionManager = require('./V1SubscriptionManager')
const Errors = require('../Errors/Errors')
const HttpErrorHandler = require('../Errors/HttpErrorHandler')
const SubscriptionErrors = require('./Errors')
const SplitTestHandler = require('../SplitTests/SplitTestHandler')
const AnalyticsManager = require('../Analytics/AnalyticsManager')
const RecurlyEventHandler = require('./RecurlyEventHandler')
const { expressify } = require('../../util/promises')
const OError = require('@overleaf/o-error')
const SUBSCRIPTION_PAGE_SPLIT_TEST = 'subscription-page'
async function plansPage(req, res) {
const plans = SubscriptionViewModelBuilder.buildPlansList()
@ -119,45 +116,13 @@ async function userSubscriptionPage(req, res) {
personalSubscription ? personalSubscription.plan : undefined
)
let subscriptionCopy = 'default'
if (
personalSubscription ||
hasSubscription ||
(memberGroupSubscriptions && memberGroupSubscriptions.length > 0) ||
currentInstitutionsWithLicence.length > 0
) {
AnalyticsManager.recordEvent(user._id, 'subscription-page-view')
} else {
try {
const testSegmentation = await SplitTestHandler.promises.getTestSegmentation(
user._id,
SUBSCRIPTION_PAGE_SPLIT_TEST
)
if (testSegmentation.enabled) {
subscriptionCopy = testSegmentation.variant
AnalyticsManager.recordEvent(user._id, 'subscription-page-view', {
splitTestId: SUBSCRIPTION_PAGE_SPLIT_TEST,
splitTestVariantId: testSegmentation.variant,
})
} else {
AnalyticsManager.recordEvent(user._id, 'subscription-page-view')
}
} catch (error) {
logger.error(
{ err: error },
`Failed to get segmentation for user '${user._id}' and split test '${SUBSCRIPTION_PAGE_SPLIT_TEST}'`
)
AnalyticsManager.recordEvent(user._id, 'subscription-page-view')
}
}
AnalyticsManager.recordEvent(user._id, 'subscription-page-view')
const data = {
title: 'your_subscription',
plans,
user,
hasSubscription,
subscriptionCopy,
fromPlansPage,
personalSubscription,
memberGroupSubscriptions,

View file

@ -55,14 +55,9 @@ block content
a(href="mailto:support@overleaf.com") support@overleaf.com
| to find out more.
else
if (subscriptionCopy === 'new')
p(ng-non-bindable) You are on the #{settings.appName} Free plan. Upgrade to access these Premium Features:
ul
li Invite more collaborators
for feature in ['realtime_track_changes', 'full_doc_history', 'reference_search', 'reference_sync', 'dropbox_integration_lowercase', 'github_integration_lowercase', 'priority_support']
li #{translate(feature)}
a(ng-controller="UpgradeSubscriptionController" href="/user/subscription/plans" ng-click="upgradeSubscription()").btn.btn-primary Upgrade now
else
p(ng-non-bindable) You're on the #{settings.appName} Free plan.
|
a(ng-controller="UpgradeSubscriptionController" href="/user/subscription/plans" ng-click="upgradeSubscription()").btn.btn-primary Upgrade now
p(ng-non-bindable) You are on the #{settings.appName} Free plan. Upgrade to access these Premium Features:
ul
li #{translate('invite_more_collabs')}
for feature in ['realtime_track_changes', 'full_doc_history', 'reference_search', 'reference_sync', 'dropbox_integration_lowercase', 'github_integration_lowercase', 'priority_support']
li #{translate(feature)}
a(ng-controller="UpgradeSubscriptionController" href="/user/subscription/plans" ng-click="upgradeSubscription()").btn.btn-primary Upgrade now

View file

@ -455,6 +455,7 @@
"github_integration_info": "Push and pull commits to and from GitHub or directly from Git, so you or your collaborators can work offline with Git and online with Overleaf.",
"latex_editor_info": "Everything you need in a modern LaTeX editor --- spell check, intelligent autocomplete, syntax highlighting, dozens of color themes, vim and emacs bindings, help with LaTeX warnings and error messages, and much more.",
"change_plans_any_time": "You can change plans or change your account at any time. ",
"invite_more_collab": "Invite more collaborators",
"number_collab": "Number of collaborators",
"unlimited_private_info": "All your projects are private by default. Invite collaborators to read or edit by email address or by sending them a secret link.",
"unlimited_private": "Unlimited private projects",