Merge pull request #8212 from overleaf/ds-remove-registration-field-home-page

Remove registration from home page

GitOrigin-RevId: 3bd04f2f2aa62ef5f3fa8a0cdd09e461c38a27e9
This commit is contained in:
Davinder Singh
2022-06-17 08:03:10 +00:00
committed by Copybot
parent b6ab0792a9
commit eba2fe9a3e
4 changed files with 45 additions and 20 deletions
@@ -37,27 +37,28 @@ async function _addAffiliation(user, affiliationOptions) {
}
async function recordRegistrationEvent(user) {
SplitTestHandler.promises
.getAssignmentForUser(user._id, 'highlight-sso')
.then(assignment => {
const segmentation = {
highlightSSO: assignment.variant === 'active',
}
if (user.thirdPartyIdentifiers && user.thirdPartyIdentifiers.length > 0) {
segmentation.provider = user.thirdPartyIdentifiers[0].providerId
}
return Analytics.recordEventForUser(
try {
const highlightSSOAssignment =
await SplitTestHandler.promises.getAssignmentForUser(
user._id,
'user-registered',
segmentation
'highlight-sso'
)
})
.catch(err =>
logger.warn(
{ err },
'there was an error recording `user-registered` event'
const homeRegistrationAssignment =
await SplitTestHandler.promises.getAssignmentForUser(
user._id,
'home-registration'
)
)
const segmentation = {
highlightSSO: highlightSSOAssignment.variant === 'active',
'home-registration': homeRegistrationAssignment.variant,
}
if (user.thirdPartyIdentifiers && user.thirdPartyIdentifiers.length > 0) {
segmentation.provider = user.thirdPartyIdentifiers[0].providerId
}
Analytics.recordEventForUser(user._id, 'user-registered', segmentation)
} catch (err) {
logger.warn({ err }, 'there was an error recording `user-registered` event')
}
}
async function createNewUser(attributes, options = {}) {