mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 16:03:37 -05:00
Merge pull request #16244 from overleaf/mf-website-redesign-analytics
[web] Implement analytics that will be used for the website-redesign split test analysis GitOrigin-RevId: 49bc0fe2049a5bf2ff676dfde93c1396002735c2
This commit is contained in:
parent
74421b3785
commit
ded18dd09b
3 changed files with 12 additions and 0 deletions
|
@ -58,6 +58,7 @@ module.exports = HomeController = {
|
|||
)
|
||||
AnalyticsManager.recordEventForSession(req.session, 'home-page-view', {
|
||||
page: req.url,
|
||||
'website-redesign': websiteRedesignVariant,
|
||||
})
|
||||
|
||||
if (websiteRedesignActive) {
|
||||
|
|
|
@ -110,6 +110,9 @@ async function plansPage(req, res) {
|
|||
)
|
||||
}
|
||||
|
||||
const websiteRedesignVariant =
|
||||
res.locals.splitTestVariants?.['website-redesign']
|
||||
|
||||
const plansPageViewSegmentation = {
|
||||
currency: recommendedCurrency,
|
||||
countryCode,
|
||||
|
@ -122,6 +125,7 @@ async function plansPage(req, res) {
|
|||
? 'latam'
|
||||
: 'default',
|
||||
'annual-trials': annualTrialsAssignment.variant,
|
||||
'website-redesign': websiteRedesignVariant,
|
||||
}
|
||||
if (inrGeoBannerSplitTestName) {
|
||||
plansPageViewSegmentation[inrGeoBannerSplitTestName] = inrGeoBannerVariant
|
||||
|
|
|
@ -43,10 +43,17 @@ async function recordRegistrationEvent(user) {
|
|||
'onboarding-flow'
|
||||
)
|
||||
|
||||
const websiteRedesignAssignment =
|
||||
await SplitTestHandler.promises.getAssignmentForUser(
|
||||
user._id,
|
||||
'website-redesign'
|
||||
)
|
||||
|
||||
try {
|
||||
const segmentation = {
|
||||
'home-registration': 'default',
|
||||
'onboarding-flow': onboardingFlowAssignment.variant,
|
||||
'website-redesign': websiteRedesignAssignment.variant,
|
||||
}
|
||||
if (user.thirdPartyIdentifiers && user.thirdPartyIdentifiers.length > 0) {
|
||||
segmentation.provider = user.thirdPartyIdentifiers[0].providerId
|
||||
|
|
Loading…
Reference in a new issue