From 2fc5602eb4abdaff717d2cec8833f2280af2dc49 Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 21 Aug 2024 21:58:15 -0600 Subject: [PATCH] Website: Track psystage and buying situation changed changes caused by start flow in Segment. (#21482) Related to: https://github.com/fleetdm/confidential/issues/7339 Changes: - Updated `save-questionnaire-progress` to return the user's selected `primaryBuyingSituation` - Updated the /start flow to update data in Segment - Removed the border on the /start flow images that I mistakenly added. --- .../api/controllers/save-questionnaire-progress.js | 2 +- website/assets/js/pages/start.page.js | 12 ++++++++++++ website/assets/styles/pages/start.less | 1 - 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/website/api/controllers/save-questionnaire-progress.js b/website/api/controllers/save-questionnaire-progress.js index 8805b2a7eb88..0b1e09fad576 100644 --- a/website/api/controllers/save-questionnaire-progress.js +++ b/website/api/controllers/save-questionnaire-progress.js @@ -221,7 +221,7 @@ module.exports = { psychologicalStageLastChangedAt, }); // Return the JSON dictionary of form data submitted by this user. - return {getStartedProgress, psychologicalStage}; + return {getStartedProgress, psychologicalStage, primaryBuyingSituation}; } diff --git a/website/assets/js/pages/start.page.js b/website/assets/js/pages/start.page.js index 08ec3abb3306..3b95e7218bc3 100644 --- a/website/assets/js/pages/start.page.js +++ b/website/assets/js/pages/start.page.js @@ -76,6 +76,7 @@ parasails.registerPage('start', { // Success state when form has been submitted cloudSuccess: false, + primaryBuyingSituation: undefined, }, // ╦ ╦╔═╗╔═╗╔═╗╦ ╦╔═╗╦ ╔═╗ @@ -139,6 +140,17 @@ parasails.registerPage('start', { this.previouslyAnsweredQuestions[this.currentStep] = questionanireProgress.getStartedProgress[this.currentStep]; this.psychologicalStage = questionanireProgress.psychologicalStage; + this.primaryBuyingSituation = questionanireProgress.primaryBuyingSituation; + if(typeof analytics !== 'undefined') { + analytics.identify(this.me.id, { + email: this.me.emailAddress, + firstName: this.me.firstName, + lastName: this.me.lastName, + company: this.me.organization, + primaryBuyingSituation: this.primaryBuyingSituation, + psychologicalStage: this.psychologicalStage, + }); + } if(_.startsWith(nextStep, '/')){ this.goto(nextStep); } else { diff --git a/website/assets/styles/pages/start.less b/website/assets/styles/pages/start.less index 555ea77effa0..bf6393f238e7 100644 --- a/website/assets/styles/pages/start.less +++ b/website/assets/styles/pages/start.less @@ -68,7 +68,6 @@ background-size: cover; background-position: center; background-repeat: no-repeat; - border: 1px solid @core-vibrant-blue-15; border-radius: 16px; &.stage-one { background-image: url('/images/psystage-1-unaware-558x680@2x.png');