|
@@ -108,7 +108,32 @@ async function plansPage(req, res) {
|
|
|
removePersonalPlanAssingment
|
|
removePersonalPlanAssingment
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- AnalyticsManager.recordEventForSession(req.session, 'plans-page-view', {
|
|
|
|
|
|
|
+ let showInrGeoBanner, inrGeoBannerSplitTestName
|
|
|
|
|
+ let inrGeoBannerVariant = 'default'
|
|
|
|
|
+ if (countryCode === 'IN') {
|
|
|
|
|
+ inrGeoBannerSplitTestName =
|
|
|
|
|
+ geoPricingINRTestVariant === 'inr'
|
|
|
|
|
+ ? 'geo-banners-inr-2'
|
|
|
|
|
+ : 'geo-banners-inr-1'
|
|
|
|
|
+ try {
|
|
|
|
|
+ const geoBannerAssignment = await SplitTestHandler.promises.getAssignment(
|
|
|
|
|
+ req,
|
|
|
|
|
+ res,
|
|
|
|
|
+ inrGeoBannerSplitTestName
|
|
|
|
|
+ )
|
|
|
|
|
+ inrGeoBannerVariant = geoBannerAssignment.variant
|
|
|
|
|
+ if (inrGeoBannerVariant !== 'default') {
|
|
|
|
|
+ showInrGeoBanner = true
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ logger.error(
|
|
|
|
|
+ { err: error },
|
|
|
|
|
+ `Failed to get INR geo banner lookup or assignment (${inrGeoBannerSplitTestName})`
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const plansPageViewSegmentation = {
|
|
|
currency: recommendedCurrency,
|
|
currency: recommendedCurrency,
|
|
|
'remove-personal-plan-page': removePersonalPlanAssingment?.variant,
|
|
'remove-personal-plan-page': removePersonalPlanAssingment?.variant,
|
|
|
countryCode,
|
|
countryCode,
|
|
@@ -120,7 +145,16 @@ async function plansPage(req, res) {
|
|
|
)
|
|
)
|
|
|
? 'latam'
|
|
? 'latam'
|
|
|
: 'default',
|
|
: 'default',
|
|
|
- })
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ if (inrGeoBannerSplitTestName) {
|
|
|
|
|
+ plansPageViewSegmentation[inrGeoBannerSplitTestName] = inrGeoBannerVariant
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ AnalyticsManager.recordEventForSession(
|
|
|
|
|
+ req.session,
|
|
|
|
|
+ 'plans-page-view',
|
|
|
|
|
+ plansPageViewSegmentation
|
|
|
|
|
+ )
|
|
|
|
|
|
|
|
res.render(`subscriptions/plans-marketing/${directory}/plans-marketing-v2`, {
|
|
res.render(`subscriptions/plans-marketing/${directory}/plans-marketing-v2`, {
|
|
|
title: 'plans_and_pricing',
|
|
title: 'plans_and_pricing',
|
|
@@ -137,6 +171,7 @@ async function plansPage(req, res) {
|
|
|
groupPlanModalDefaults,
|
|
groupPlanModalDefaults,
|
|
|
initialLocalizedGroupPrice:
|
|
initialLocalizedGroupPrice:
|
|
|
SubscriptionHelper.generateInitialLocalizedGroupPrice(currency),
|
|
SubscriptionHelper.generateInitialLocalizedGroupPrice(currency),
|
|
|
|
|
+ showInrGeoBanner,
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -302,23 +337,52 @@ async function interstitialPaymentPage(req, res) {
|
|
|
if (hasSubscription) {
|
|
if (hasSubscription) {
|
|
|
res.redirect('/user/subscription?hasSubscription=true')
|
|
res.redirect('/user/subscription?hasSubscription=true')
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ let showInrGeoBanner, inrGeoBannerSplitTestName
|
|
|
|
|
+ let inrGeoBannerVariant = 'default'
|
|
|
|
|
+ if (countryCode === 'IN') {
|
|
|
|
|
+ inrGeoBannerSplitTestName =
|
|
|
|
|
+ geoPricingINRTestVariant === 'inr'
|
|
|
|
|
+ ? 'geo-banners-inr-2'
|
|
|
|
|
+ : 'geo-banners-inr-1'
|
|
|
|
|
+ try {
|
|
|
|
|
+ const geoBannerAssignment =
|
|
|
|
|
+ await SplitTestHandler.promises.getAssignment(
|
|
|
|
|
+ req,
|
|
|
|
|
+ res,
|
|
|
|
|
+ inrGeoBannerSplitTestName
|
|
|
|
|
+ )
|
|
|
|
|
+ inrGeoBannerVariant = geoBannerAssignment.variant
|
|
|
|
|
+ if (inrGeoBannerVariant !== 'default') {
|
|
|
|
|
+ showInrGeoBanner = true
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ logger.error(
|
|
|
|
|
+ { err: error },
|
|
|
|
|
+ `Failed to get INR geo banner lookup or assignment (${inrGeoBannerSplitTestName})`
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ const paywallPlansPageViewSegmentation = {
|
|
|
|
|
+ currency: recommendedCurrency,
|
|
|
|
|
+ countryCode,
|
|
|
|
|
+ 'geo-pricing-inr-group': geoPricingINRTestVariant,
|
|
|
|
|
+ 'geo-pricing-inr-page': recommendedCurrency === 'INR' ? 'inr' : 'default',
|
|
|
|
|
+ 'geo-pricing-latam-group': geoPricingLATAMTestVariant,
|
|
|
|
|
+ 'geo-pricing-latam-page': ['BRL', 'MXN', 'COP', 'CLP', 'PEN'].includes(
|
|
|
|
|
+ recommendedCurrency
|
|
|
|
|
+ )
|
|
|
|
|
+ ? 'latam'
|
|
|
|
|
+ : 'default',
|
|
|
|
|
+ 'remove-personal-plan-page': removePersonalPlanAssingment?.variant,
|
|
|
|
|
+ }
|
|
|
|
|
+ if (inrGeoBannerSplitTestName) {
|
|
|
|
|
+ paywallPlansPageViewSegmentation[inrGeoBannerSplitTestName] =
|
|
|
|
|
+ inrGeoBannerVariant
|
|
|
|
|
+ }
|
|
|
AnalyticsManager.recordEventForSession(
|
|
AnalyticsManager.recordEventForSession(
|
|
|
req.session,
|
|
req.session,
|
|
|
'paywall-plans-page-view',
|
|
'paywall-plans-page-view',
|
|
|
- {
|
|
|
|
|
- currency: recommendedCurrency,
|
|
|
|
|
- countryCode,
|
|
|
|
|
- 'geo-pricing-inr-group': geoPricingINRTestVariant,
|
|
|
|
|
- 'geo-pricing-inr-page':
|
|
|
|
|
- recommendedCurrency === 'INR' ? 'inr' : 'default',
|
|
|
|
|
- 'geo-pricing-latam-group': geoPricingLATAMTestVariant,
|
|
|
|
|
- 'geo-pricing-latam-page': ['BRL', 'MXN', 'COP', 'CLP', 'PEN'].includes(
|
|
|
|
|
- recommendedCurrency
|
|
|
|
|
- )
|
|
|
|
|
- ? 'latam'
|
|
|
|
|
- : 'default',
|
|
|
|
|
- 'remove-personal-plan-page': removePersonalPlanAssingment?.variant,
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ paywallPlansPageViewSegmentation
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
res.render(
|
|
res.render(
|
|
@@ -331,6 +395,7 @@ async function interstitialPaymentPage(req, res) {
|
|
|
recommendedCurrency,
|
|
recommendedCurrency,
|
|
|
interstitialPaymentConfig,
|
|
interstitialPaymentConfig,
|
|
|
showSkipLink,
|
|
showSkipLink,
|
|
|
|
|
+ showInrGeoBanner,
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
@@ -678,10 +743,12 @@ async function _getRecommendedCurrency(req, res) {
|
|
|
req.query?.ip || req.ip
|
|
req.query?.ip || req.ip
|
|
|
)
|
|
)
|
|
|
const countryCode = currencyLookup.countryCode
|
|
const countryCode = currencyLookup.countryCode
|
|
|
- let recommendedCurrency = currencyLookup.currencyCode
|
|
|
|
|
let assignmentINR, assignmentLATAM
|
|
let assignmentINR, assignmentLATAM
|
|
|
|
|
+ let recommendedCurrency = currencyLookup.currencyCode
|
|
|
// for #12703
|
|
// for #12703
|
|
|
try {
|
|
try {
|
|
|
|
|
+ // Split test is kept active, but all users geolocated in India can
|
|
|
|
|
+ // now use the INR currency (See #13507)
|
|
|
assignmentINR = await SplitTestHandler.promises.getAssignment(
|
|
assignmentINR = await SplitTestHandler.promises.getAssignment(
|
|
|
req,
|
|
req,
|
|
|
res,
|
|
res,
|
|
@@ -706,11 +773,6 @@ async function _getRecommendedCurrency(req, res) {
|
|
|
'Failed to get assignment for geo-pricing-latam test'
|
|
'Failed to get assignment for geo-pricing-latam test'
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
- // if the user has been detected as located in India (thus recommended INR as currency)
|
|
|
|
|
- // but is not part of the geo pricing test, we fall back to the default currency instead
|
|
|
|
|
- if (recommendedCurrency === 'INR' && assignmentINR?.variant !== 'inr') {
|
|
|
|
|
- recommendedCurrency = GeoIpLookup.DEFAULT_CURRENCY_CODE
|
|
|
|
|
- }
|
|
|
|
|
if (
|
|
if (
|
|
|
['BRL', 'MXN', 'COP', 'CLP', 'PEN'].includes(recommendedCurrency) &&
|
|
['BRL', 'MXN', 'COP', 'CLP', 'PEN'].includes(recommendedCurrency) &&
|
|
|
assignmentLATAM?.variant !== 'latam'
|
|
assignmentLATAM?.variant !== 'latam'
|