From 4ed8a1d24f60009803e700ff7ec7e979a21ee0c4 Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 1 Mar 2024 18:33:36 -0600 Subject: [PATCH] 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. --- website/api/hooks/custom/index.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/website/api/hooks/custom/index.js b/website/api/hooks/custom/index.js index 23d6c3bb2a..c2039959bc 100644 --- a/website/api/hooks/custom/index.js +++ b/website/api/hooks/custom/index.js @@ -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,