Website: Update personalization in custom hook (#17324)

Changes:
- Updated the custom hook to not set
`req.session.primaryBuyingSituation` as undefined if a user does not
have a `utm_content` query parameter.
This commit is contained in:
Eric 2024-03-01 18:33:36 -06:00 committed by GitHub
parent ea5b8f8204
commit 4ed8a1d24f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -155,14 +155,12 @@ will be disabled and/or hidden in the UI.
req.session.primaryBuyingSituation = req.param('utm_content');
// FUTURE: Auto-redirect without the querystring after absorbtion to make it prettier in the URL bar.
// (except this probably messes up analytics so before doing that, figure out how to solve that problem)
} else {
req.session.primaryBuyingSituation = undefined;
}
}//fi
if (req.method === 'GET') {
// Include information about the primary buying situation
// If set in the session (e.g. from an ad), use the primary buying situation for personalization.
res.locals.primaryBuyingSituation = req.session.primaryBuyingSituation || undefined;
}
}//fi
// Next, if we're running in our actual "production" or "staging" Sails
// environment, check if this is a GET request via some other host,