mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
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:
parent
2feea2592d
commit
ffb30435d8
3 changed files with 8 additions and 47 deletions
|
@ -14,14 +14,11 @@ const V1SubscriptionManager = require('./V1SubscriptionManager')
|
||||||
const Errors = require('../Errors/Errors')
|
const Errors = require('../Errors/Errors')
|
||||||
const HttpErrorHandler = require('../Errors/HttpErrorHandler')
|
const HttpErrorHandler = require('../Errors/HttpErrorHandler')
|
||||||
const SubscriptionErrors = require('./Errors')
|
const SubscriptionErrors = require('./Errors')
|
||||||
const SplitTestHandler = require('../SplitTests/SplitTestHandler')
|
|
||||||
const AnalyticsManager = require('../Analytics/AnalyticsManager')
|
const AnalyticsManager = require('../Analytics/AnalyticsManager')
|
||||||
const RecurlyEventHandler = require('./RecurlyEventHandler')
|
const RecurlyEventHandler = require('./RecurlyEventHandler')
|
||||||
const { expressify } = require('../../util/promises')
|
const { expressify } = require('../../util/promises')
|
||||||
const OError = require('@overleaf/o-error')
|
const OError = require('@overleaf/o-error')
|
||||||
|
|
||||||
const SUBSCRIPTION_PAGE_SPLIT_TEST = 'subscription-page'
|
|
||||||
|
|
||||||
async function plansPage(req, res) {
|
async function plansPage(req, res) {
|
||||||
const plans = SubscriptionViewModelBuilder.buildPlansList()
|
const plans = SubscriptionViewModelBuilder.buildPlansList()
|
||||||
|
|
||||||
|
@ -119,45 +116,13 @@ async function userSubscriptionPage(req, res) {
|
||||||
personalSubscription ? personalSubscription.plan : undefined
|
personalSubscription ? personalSubscription.plan : undefined
|
||||||
)
|
)
|
||||||
|
|
||||||
let subscriptionCopy = 'default'
|
|
||||||
if (
|
|
||||||
personalSubscription ||
|
|
||||||
hasSubscription ||
|
|
||||||
(memberGroupSubscriptions && memberGroupSubscriptions.length > 0) ||
|
|
||||||
currentInstitutionsWithLicence.length > 0
|
|
||||||
) {
|
|
||||||
AnalyticsManager.recordEvent(user._id, 'subscription-page-view')
|
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')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
title: 'your_subscription',
|
title: 'your_subscription',
|
||||||
plans,
|
plans,
|
||||||
user,
|
user,
|
||||||
hasSubscription,
|
hasSubscription,
|
||||||
subscriptionCopy,
|
|
||||||
fromPlansPage,
|
fromPlansPage,
|
||||||
personalSubscription,
|
personalSubscription,
|
||||||
memberGroupSubscriptions,
|
memberGroupSubscriptions,
|
||||||
|
|
|
@ -55,14 +55,9 @@ block content
|
||||||
a(href="mailto:support@overleaf.com") support@overleaf.com
|
a(href="mailto:support@overleaf.com") support@overleaf.com
|
||||||
| to find out more.
|
| to find out more.
|
||||||
else
|
else
|
||||||
if (subscriptionCopy === 'new')
|
|
||||||
p(ng-non-bindable) You are on the #{settings.appName} Free plan. Upgrade to access these Premium Features:
|
p(ng-non-bindable) You are on the #{settings.appName} Free plan. Upgrade to access these Premium Features:
|
||||||
ul
|
ul
|
||||||
li Invite more collaborators
|
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']
|
for feature in ['realtime_track_changes', 'full_doc_history', 'reference_search', 'reference_sync', 'dropbox_integration_lowercase', 'github_integration_lowercase', 'priority_support']
|
||||||
li #{translate(feature)}
|
li #{translate(feature)}
|
||||||
a(ng-controller="UpgradeSubscriptionController" href="/user/subscription/plans" ng-click="upgradeSubscription()").btn.btn-primary Upgrade now
|
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
|
|
||||||
|
|
|
@ -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.",
|
"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.",
|
"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. ",
|
"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",
|
"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_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",
|
"unlimited_private": "Unlimited private projects",
|
||||||
|
|
Loading…
Reference in a new issue