From 2e8c24fb7a4a7a9cbd1c6541deee7021b38eba45 Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Thu, 30 Jan 2025 09:56:15 -0700 Subject: [PATCH 1/5] fix(app-rfi): ga track default disabled for pii --- packages/app-rfi/src/components/AsuRfi/index.js | 4 ++++ .../app-rfi/src/components/AsuRfi/story.helper.js | 1 + .../src/components/steps/questions/Country.js | 9 +++++++-- .../components/steps/questions/EmailAddress.js | 9 +++++++-- .../src/components/steps/questions/FirstName.js | 9 +++++++-- .../src/components/steps/questions/LastName.js | 9 +++++++-- .../src/components/steps/questions/Phone.js | 9 +++++++-- .../src/components/steps/questions/ZipCode.js | 9 +++++++-- packages/app-rfi/src/core/types/rfi-types.js | 2 ++ packages/app-rfi/src/core/utils/useDataLayer.js | 15 +++++++++++++++ 10 files changed, 64 insertions(+), 12 deletions(-) create mode 100644 packages/app-rfi/src/core/utils/useDataLayer.js diff --git a/packages/app-rfi/src/components/AsuRfi/index.js b/packages/app-rfi/src/components/AsuRfi/index.js index 207f924847..49c29f879b 100644 --- a/packages/app-rfi/src/components/AsuRfi/index.js +++ b/packages/app-rfi/src/components/AsuRfi/index.js @@ -44,6 +44,7 @@ const AsuRfi = props => { country, stateProvince, successMsg, + dataLayerEnabled, test, dataSourceDegreeSearch, dataSourceAsuOnline, @@ -99,6 +100,7 @@ const AsuRfi = props => { country, stateProvince, successMsg, + dataLayerEnabled, test, dataSourceDegreeSearch, dataSourceAsuOnline, @@ -150,6 +152,7 @@ AsuRfi.defaultProps = { country: undefined, stateProvince: undefined, successMsg: undefined, + dataLayerEnabled: false, test: false, dataSourceDegreeSearch: DATA_SOURCE.DEGREE_SEARCH, dataSourceAsuOnline: DATA_SOURCE.ASU_ONLINE, @@ -175,6 +178,7 @@ AsuRfi.propTypes = { country: PropTypes.string, stateProvince: PropTypes.string, successMsg: PropTypes.string, + dataLayerEnabled: PropTypes.bool, test: PropTypes.bool, dataSourceDegreeSearch: PropTypes.string, dataSourceAsuOnline: PropTypes.string, diff --git a/packages/app-rfi/src/components/AsuRfi/story.helper.js b/packages/app-rfi/src/components/AsuRfi/story.helper.js index 2b7d9c925b..f228fbf2df 100644 --- a/packages/app-rfi/src/components/AsuRfi/story.helper.js +++ b/packages/app-rfi/src/components/AsuRfi/story.helper.js @@ -23,6 +23,7 @@ export const defaultArgs = { country: undefined, stateProvince: undefined, // Only US states or CA provinces - use full name. successMsg: undefined, + dataLayerEnabled: false, test: false, dataSourceDegreeSearch: undefined, // "https://degrees.apps.asu.edu/t5/service", dataSourceAsuOnline: undefined, // "https://cms.asuonline.asu.edu/lead-submissions-v3.5/programs", diff --git a/packages/app-rfi/src/components/steps/questions/Country.js b/packages/app-rfi/src/components/steps/questions/Country.js index 5e93c06c9b..62f40f9388 100644 --- a/packages/app-rfi/src/components/steps/questions/Country.js +++ b/packages/app-rfi/src/components/steps/questions/Country.js @@ -1,8 +1,11 @@ import React, { useEffect, useState } from "react"; -import { gaEventPropTypes, trackGAEvent } from "../../../../../../shared"; import { fetchCountries } from "../../../core/utils/fetchCountries"; import { useRfiContext } from "../../../core/utils/rfiContext"; +import { + gaEventPropTypes, + useTryGAEvent, +} from "../../../core/utils/useDataLayer"; import { RfiSelect } from "../../controls"; // Options @@ -45,6 +48,8 @@ export const Country = ({ gaData }) => { }); }, []); // Run only once + const tryGAEvent = useTryGAEvent(); + return ( { name={name} options={countryOptions} onBlur={e => - trackGAEvent({ + tryGAEvent({ ...gaData, event: "select", type: label, diff --git a/packages/app-rfi/src/components/steps/questions/EmailAddress.js b/packages/app-rfi/src/components/steps/questions/EmailAddress.js index bf51c856ec..a760c8d61f 100644 --- a/packages/app-rfi/src/components/steps/questions/EmailAddress.js +++ b/packages/app-rfi/src/components/steps/questions/EmailAddress.js @@ -1,6 +1,9 @@ import React from "react"; -import { gaEventPropTypes, trackGAEvent } from "../../../../../../shared"; +import { + gaEventPropTypes, + useTryGAEvent, +} from "../../../core/utils/useDataLayer"; import { RfiEmailInput } from "../../controls"; /** @@ -10,6 +13,8 @@ export const EmailAddress = ({ gaData }) => { const label = "Email Address"; const name = "EmailAddress"; + const tryGAEvent = useTryGAEvent(); + return ( { requiredIcon required onBlur={e => - trackGAEvent({ + tryGAEvent({ ...gaData, type: label, text: e.target.value, diff --git a/packages/app-rfi/src/components/steps/questions/FirstName.js b/packages/app-rfi/src/components/steps/questions/FirstName.js index 92e2029de2..a691c04762 100644 --- a/packages/app-rfi/src/components/steps/questions/FirstName.js +++ b/packages/app-rfi/src/components/steps/questions/FirstName.js @@ -1,6 +1,9 @@ import React from "react"; -import { gaEventPropTypes, trackGAEvent } from "../../../../../../shared"; +import { + gaEventPropTypes, + useTryGAEvent, +} from "../../../core/utils/useDataLayer"; import { RfiTextInput } from "../../controls"; /** @@ -10,6 +13,8 @@ export const FirstName = ({ gaData }) => { const label = "First name"; const name = "FirstName"; + const tryGAEvent = useTryGAEvent(); + return ( { requiredIcon required onBlur={e => - trackGAEvent({ + tryGAEvent({ ...gaData, type: label, text: e.target.value, diff --git a/packages/app-rfi/src/components/steps/questions/LastName.js b/packages/app-rfi/src/components/steps/questions/LastName.js index 68375bddc9..ea2625742a 100644 --- a/packages/app-rfi/src/components/steps/questions/LastName.js +++ b/packages/app-rfi/src/components/steps/questions/LastName.js @@ -1,6 +1,9 @@ import React from "react"; -import { gaEventPropTypes, trackGAEvent } from "../../../../../../shared"; +import { + gaEventPropTypes, + useTryGAEvent, +} from "../../../core/utils/useDataLayer"; import { RfiTextInput } from "../../controls"; /** @@ -10,6 +13,8 @@ export const LastName = ({ gaData }) => { const label = "Last name"; const name = "LastName"; + const tryGAEvent = useTryGAEvent(); + return ( { requiredIcon required onBlur={e => - trackGAEvent({ + tryGAEvent({ ...gaData, type: label, text: e.target.value, diff --git a/packages/app-rfi/src/components/steps/questions/Phone.js b/packages/app-rfi/src/components/steps/questions/Phone.js index 138950c9fe..224971bfbd 100644 --- a/packages/app-rfi/src/components/steps/questions/Phone.js +++ b/packages/app-rfi/src/components/steps/questions/Phone.js @@ -1,6 +1,9 @@ import React from "react"; -import { gaEventPropTypes, trackGAEvent } from "../../../../../../shared"; +import { + gaEventPropTypes, + useTryGAEvent, +} from "../../../core/utils/useDataLayer"; import { RfiPhone } from "../../controls"; /** @@ -10,6 +13,8 @@ export const Phone = ({ gaData }) => { const label = "Phone"; const name = "Phone"; + const tryGAEvent = useTryGAEvent(); + return ( { requiredIcon required onBlur={e => - trackGAEvent({ + tryGAEvent({ ...gaData, type: label, text: e.target.value, diff --git a/packages/app-rfi/src/components/steps/questions/ZipCode.js b/packages/app-rfi/src/components/steps/questions/ZipCode.js index 3083b7fd00..4603fd8739 100644 --- a/packages/app-rfi/src/components/steps/questions/ZipCode.js +++ b/packages/app-rfi/src/components/steps/questions/ZipCode.js @@ -1,8 +1,11 @@ import React, { useEffect } from "react"; -import { gaEventPropTypes, trackGAEvent } from "../../../../../../shared"; import { KEY } from "../../../core/utils/constants"; import { useRfiContext } from "../../../core/utils/rfiContext"; +import { + gaEventPropTypes, + useTryGAEvent, +} from "../../../core/utils/useDataLayer"; import { RfiTextInput } from "../../controls"; /** @@ -31,6 +34,8 @@ export const ZipCode = ({ gaData }) => { return <>; } + const tryGAEvent = useTryGAEvent(); + return ( { requiredIcon required onBlur={e => - trackGAEvent({ + tryGAEvent({ ...gaData, type: label, text: e.target.value, diff --git a/packages/app-rfi/src/core/types/rfi-types.js b/packages/app-rfi/src/core/types/rfi-types.js index fe10e2a892..84c8c12d72 100644 --- a/packages/app-rfi/src/core/types/rfi-types.js +++ b/packages/app-rfi/src/core/types/rfi-types.js @@ -17,6 +17,7 @@ * @property {string} [country] * @property {string} [stateProvince] * @property {string} [successMsg] + * @property {boolean} [dataLayerEnabled] * @property {boolean} [test] * @property {string} [dataSourceDegreeSearch] * @property {string} [dataSourceAsuOnline] @@ -46,6 +47,7 @@ * @property {string} [country] * @property {string} [stateProvince] * @property {string} [successMsg] + * @property {boolean} [dataLayerEnabled] * @property {boolean} [test] * @property {string} [dataSourceDegreeSearch] * @property {string} [dataSourceAsuOnline] diff --git a/packages/app-rfi/src/core/utils/useDataLayer.js b/packages/app-rfi/src/core/utils/useDataLayer.js new file mode 100644 index 0000000000..001ed1f7fd --- /dev/null +++ b/packages/app-rfi/src/core/utils/useDataLayer.js @@ -0,0 +1,15 @@ +// @ts-check +import { trackGAEvent as fn } from "../../../../../shared"; +import { useRfiContext } from "./rfiContext"; + +export { gaEventPropTypes } from "../../../../../shared"; + +export const useTryGAEvent = () => { + const { dataLayerEnabled } = useRfiContext(); + + if (dataLayerEnabled) { + return fn; + } + // return NOOP function + return () => {}; +}; From 41aac6801fe6b2d924169a1f715484783e45fa9f Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Thu, 30 Jan 2025 13:26:05 -0700 Subject: [PATCH 2/5] fix(app-rfi): ga track default disabled for pii --- packages/app-rfi/src/core/utils/useDataLayer.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/app-rfi/src/core/utils/useDataLayer.js b/packages/app-rfi/src/core/utils/useDataLayer.js index 001ed1f7fd..c79ce75523 100644 --- a/packages/app-rfi/src/core/utils/useDataLayer.js +++ b/packages/app-rfi/src/core/utils/useDataLayer.js @@ -10,6 +10,7 @@ export const useTryGAEvent = () => { if (dataLayerEnabled) { return fn; } + // UDS-1943 : allow some fields to be exempted from data layer (PII) // return NOOP function return () => {}; }; From 1ca1c1ee36d4e3760b8ef48dcaf96b6f9120049b Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Thu, 30 Jan 2025 13:49:53 -0700 Subject: [PATCH 3/5] Revert "fix(app-rfi): ga track default disabled for pii" This reverts commit 41aac6801fe6b2d924169a1f715484783e45fa9f. --- packages/app-rfi/src/core/utils/useDataLayer.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/app-rfi/src/core/utils/useDataLayer.js b/packages/app-rfi/src/core/utils/useDataLayer.js index c79ce75523..001ed1f7fd 100644 --- a/packages/app-rfi/src/core/utils/useDataLayer.js +++ b/packages/app-rfi/src/core/utils/useDataLayer.js @@ -10,7 +10,6 @@ export const useTryGAEvent = () => { if (dataLayerEnabled) { return fn; } - // UDS-1943 : allow some fields to be exempted from data layer (PII) // return NOOP function return () => {}; }; From ca8207e6df7d3473f95173c18b7766148dc1f32a Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Thu, 30 Jan 2025 13:49:59 -0700 Subject: [PATCH 4/5] Revert "fix(app-rfi): ga track default disabled for pii" This reverts commit 2e8c24fb7a4a7a9cbd1c6541deee7021b38eba45. --- packages/app-rfi/src/components/AsuRfi/index.js | 4 ---- .../app-rfi/src/components/AsuRfi/story.helper.js | 1 - .../src/components/steps/questions/Country.js | 9 ++------- .../components/steps/questions/EmailAddress.js | 9 ++------- .../src/components/steps/questions/FirstName.js | 9 ++------- .../src/components/steps/questions/LastName.js | 9 ++------- .../src/components/steps/questions/Phone.js | 9 ++------- .../src/components/steps/questions/ZipCode.js | 9 ++------- packages/app-rfi/src/core/types/rfi-types.js | 2 -- packages/app-rfi/src/core/utils/useDataLayer.js | 15 --------------- 10 files changed, 12 insertions(+), 64 deletions(-) delete mode 100644 packages/app-rfi/src/core/utils/useDataLayer.js diff --git a/packages/app-rfi/src/components/AsuRfi/index.js b/packages/app-rfi/src/components/AsuRfi/index.js index 49c29f879b..207f924847 100644 --- a/packages/app-rfi/src/components/AsuRfi/index.js +++ b/packages/app-rfi/src/components/AsuRfi/index.js @@ -44,7 +44,6 @@ const AsuRfi = props => { country, stateProvince, successMsg, - dataLayerEnabled, test, dataSourceDegreeSearch, dataSourceAsuOnline, @@ -100,7 +99,6 @@ const AsuRfi = props => { country, stateProvince, successMsg, - dataLayerEnabled, test, dataSourceDegreeSearch, dataSourceAsuOnline, @@ -152,7 +150,6 @@ AsuRfi.defaultProps = { country: undefined, stateProvince: undefined, successMsg: undefined, - dataLayerEnabled: false, test: false, dataSourceDegreeSearch: DATA_SOURCE.DEGREE_SEARCH, dataSourceAsuOnline: DATA_SOURCE.ASU_ONLINE, @@ -178,7 +175,6 @@ AsuRfi.propTypes = { country: PropTypes.string, stateProvince: PropTypes.string, successMsg: PropTypes.string, - dataLayerEnabled: PropTypes.bool, test: PropTypes.bool, dataSourceDegreeSearch: PropTypes.string, dataSourceAsuOnline: PropTypes.string, diff --git a/packages/app-rfi/src/components/AsuRfi/story.helper.js b/packages/app-rfi/src/components/AsuRfi/story.helper.js index f228fbf2df..2b7d9c925b 100644 --- a/packages/app-rfi/src/components/AsuRfi/story.helper.js +++ b/packages/app-rfi/src/components/AsuRfi/story.helper.js @@ -23,7 +23,6 @@ export const defaultArgs = { country: undefined, stateProvince: undefined, // Only US states or CA provinces - use full name. successMsg: undefined, - dataLayerEnabled: false, test: false, dataSourceDegreeSearch: undefined, // "https://degrees.apps.asu.edu/t5/service", dataSourceAsuOnline: undefined, // "https://cms.asuonline.asu.edu/lead-submissions-v3.5/programs", diff --git a/packages/app-rfi/src/components/steps/questions/Country.js b/packages/app-rfi/src/components/steps/questions/Country.js index 62f40f9388..5e93c06c9b 100644 --- a/packages/app-rfi/src/components/steps/questions/Country.js +++ b/packages/app-rfi/src/components/steps/questions/Country.js @@ -1,11 +1,8 @@ import React, { useEffect, useState } from "react"; +import { gaEventPropTypes, trackGAEvent } from "../../../../../../shared"; import { fetchCountries } from "../../../core/utils/fetchCountries"; import { useRfiContext } from "../../../core/utils/rfiContext"; -import { - gaEventPropTypes, - useTryGAEvent, -} from "../../../core/utils/useDataLayer"; import { RfiSelect } from "../../controls"; // Options @@ -48,8 +45,6 @@ export const Country = ({ gaData }) => { }); }, []); // Run only once - const tryGAEvent = useTryGAEvent(); - return ( { name={name} options={countryOptions} onBlur={e => - tryGAEvent({ + trackGAEvent({ ...gaData, event: "select", type: label, diff --git a/packages/app-rfi/src/components/steps/questions/EmailAddress.js b/packages/app-rfi/src/components/steps/questions/EmailAddress.js index a760c8d61f..bf51c856ec 100644 --- a/packages/app-rfi/src/components/steps/questions/EmailAddress.js +++ b/packages/app-rfi/src/components/steps/questions/EmailAddress.js @@ -1,9 +1,6 @@ import React from "react"; -import { - gaEventPropTypes, - useTryGAEvent, -} from "../../../core/utils/useDataLayer"; +import { gaEventPropTypes, trackGAEvent } from "../../../../../../shared"; import { RfiEmailInput } from "../../controls"; /** @@ -13,8 +10,6 @@ export const EmailAddress = ({ gaData }) => { const label = "Email Address"; const name = "EmailAddress"; - const tryGAEvent = useTryGAEvent(); - return ( { requiredIcon required onBlur={e => - tryGAEvent({ + trackGAEvent({ ...gaData, type: label, text: e.target.value, diff --git a/packages/app-rfi/src/components/steps/questions/FirstName.js b/packages/app-rfi/src/components/steps/questions/FirstName.js index a691c04762..92e2029de2 100644 --- a/packages/app-rfi/src/components/steps/questions/FirstName.js +++ b/packages/app-rfi/src/components/steps/questions/FirstName.js @@ -1,9 +1,6 @@ import React from "react"; -import { - gaEventPropTypes, - useTryGAEvent, -} from "../../../core/utils/useDataLayer"; +import { gaEventPropTypes, trackGAEvent } from "../../../../../../shared"; import { RfiTextInput } from "../../controls"; /** @@ -13,8 +10,6 @@ export const FirstName = ({ gaData }) => { const label = "First name"; const name = "FirstName"; - const tryGAEvent = useTryGAEvent(); - return ( { requiredIcon required onBlur={e => - tryGAEvent({ + trackGAEvent({ ...gaData, type: label, text: e.target.value, diff --git a/packages/app-rfi/src/components/steps/questions/LastName.js b/packages/app-rfi/src/components/steps/questions/LastName.js index ea2625742a..68375bddc9 100644 --- a/packages/app-rfi/src/components/steps/questions/LastName.js +++ b/packages/app-rfi/src/components/steps/questions/LastName.js @@ -1,9 +1,6 @@ import React from "react"; -import { - gaEventPropTypes, - useTryGAEvent, -} from "../../../core/utils/useDataLayer"; +import { gaEventPropTypes, trackGAEvent } from "../../../../../../shared"; import { RfiTextInput } from "../../controls"; /** @@ -13,8 +10,6 @@ export const LastName = ({ gaData }) => { const label = "Last name"; const name = "LastName"; - const tryGAEvent = useTryGAEvent(); - return ( { requiredIcon required onBlur={e => - tryGAEvent({ + trackGAEvent({ ...gaData, type: label, text: e.target.value, diff --git a/packages/app-rfi/src/components/steps/questions/Phone.js b/packages/app-rfi/src/components/steps/questions/Phone.js index 224971bfbd..138950c9fe 100644 --- a/packages/app-rfi/src/components/steps/questions/Phone.js +++ b/packages/app-rfi/src/components/steps/questions/Phone.js @@ -1,9 +1,6 @@ import React from "react"; -import { - gaEventPropTypes, - useTryGAEvent, -} from "../../../core/utils/useDataLayer"; +import { gaEventPropTypes, trackGAEvent } from "../../../../../../shared"; import { RfiPhone } from "../../controls"; /** @@ -13,8 +10,6 @@ export const Phone = ({ gaData }) => { const label = "Phone"; const name = "Phone"; - const tryGAEvent = useTryGAEvent(); - return ( { requiredIcon required onBlur={e => - tryGAEvent({ + trackGAEvent({ ...gaData, type: label, text: e.target.value, diff --git a/packages/app-rfi/src/components/steps/questions/ZipCode.js b/packages/app-rfi/src/components/steps/questions/ZipCode.js index 4603fd8739..3083b7fd00 100644 --- a/packages/app-rfi/src/components/steps/questions/ZipCode.js +++ b/packages/app-rfi/src/components/steps/questions/ZipCode.js @@ -1,11 +1,8 @@ import React, { useEffect } from "react"; +import { gaEventPropTypes, trackGAEvent } from "../../../../../../shared"; import { KEY } from "../../../core/utils/constants"; import { useRfiContext } from "../../../core/utils/rfiContext"; -import { - gaEventPropTypes, - useTryGAEvent, -} from "../../../core/utils/useDataLayer"; import { RfiTextInput } from "../../controls"; /** @@ -34,8 +31,6 @@ export const ZipCode = ({ gaData }) => { return <>; } - const tryGAEvent = useTryGAEvent(); - return ( { requiredIcon required onBlur={e => - tryGAEvent({ + trackGAEvent({ ...gaData, type: label, text: e.target.value, diff --git a/packages/app-rfi/src/core/types/rfi-types.js b/packages/app-rfi/src/core/types/rfi-types.js index 84c8c12d72..fe10e2a892 100644 --- a/packages/app-rfi/src/core/types/rfi-types.js +++ b/packages/app-rfi/src/core/types/rfi-types.js @@ -17,7 +17,6 @@ * @property {string} [country] * @property {string} [stateProvince] * @property {string} [successMsg] - * @property {boolean} [dataLayerEnabled] * @property {boolean} [test] * @property {string} [dataSourceDegreeSearch] * @property {string} [dataSourceAsuOnline] @@ -47,7 +46,6 @@ * @property {string} [country] * @property {string} [stateProvince] * @property {string} [successMsg] - * @property {boolean} [dataLayerEnabled] * @property {boolean} [test] * @property {string} [dataSourceDegreeSearch] * @property {string} [dataSourceAsuOnline] diff --git a/packages/app-rfi/src/core/utils/useDataLayer.js b/packages/app-rfi/src/core/utils/useDataLayer.js deleted file mode 100644 index 001ed1f7fd..0000000000 --- a/packages/app-rfi/src/core/utils/useDataLayer.js +++ /dev/null @@ -1,15 +0,0 @@ -// @ts-check -import { trackGAEvent as fn } from "../../../../../shared"; -import { useRfiContext } from "./rfiContext"; - -export { gaEventPropTypes } from "../../../../../shared"; - -export const useTryGAEvent = () => { - const { dataLayerEnabled } = useRfiContext(); - - if (dataLayerEnabled) { - return fn; - } - // return NOOP function - return () => {}; -}; From 9bef080877a1d855c3949e409cd87f056e49ff52 Mon Sep 17 00:00:00 2001 From: Scott Williams Date: Thu, 30 Jan 2025 13:46:32 -0700 Subject: [PATCH 5/5] fix(app-rfi): prevent sending pii to data layer --- packages/app-rfi/src/components/steps/questions/Country.js | 3 ++- .../app-rfi/src/components/steps/questions/EmailAddress.js | 3 ++- packages/app-rfi/src/components/steps/questions/FirstName.js | 3 ++- packages/app-rfi/src/components/steps/questions/LastName.js | 3 ++- packages/app-rfi/src/components/steps/questions/Phone.js | 3 ++- packages/app-rfi/src/components/steps/questions/ZipCode.js | 4 ++-- packages/app-rfi/src/core/utils/constants.js | 4 ++++ 7 files changed, 16 insertions(+), 7 deletions(-) diff --git a/packages/app-rfi/src/components/steps/questions/Country.js b/packages/app-rfi/src/components/steps/questions/Country.js index 5e93c06c9b..640176ad5d 100644 --- a/packages/app-rfi/src/components/steps/questions/Country.js +++ b/packages/app-rfi/src/components/steps/questions/Country.js @@ -4,6 +4,7 @@ import { gaEventPropTypes, trackGAEvent } from "../../../../../../shared"; import { fetchCountries } from "../../../core/utils/fetchCountries"; import { useRfiContext } from "../../../core/utils/rfiContext"; import { RfiSelect } from "../../controls"; +import { PII_VALUE } from "../../../core/utils/constants"; // Options function getCountryOptions(resultsArrayOfObjects) { @@ -56,7 +57,7 @@ export const Country = ({ gaData }) => { ...gaData, event: "select", type: label, - text: e.target.selectedOptions[0].innerText, + text: PII_VALUE, }) } /> diff --git a/packages/app-rfi/src/components/steps/questions/EmailAddress.js b/packages/app-rfi/src/components/steps/questions/EmailAddress.js index bf51c856ec..b70569f949 100644 --- a/packages/app-rfi/src/components/steps/questions/EmailAddress.js +++ b/packages/app-rfi/src/components/steps/questions/EmailAddress.js @@ -2,6 +2,7 @@ import React from "react"; import { gaEventPropTypes, trackGAEvent } from "../../../../../../shared"; import { RfiEmailInput } from "../../controls"; +import { PII_VALUE } from "../../../core/utils/constants"; /** * @param {{ gaData: import("../../../../../../shared/services/googleAnalytics").GAEventObject}} props @@ -21,7 +22,7 @@ export const EmailAddress = ({ gaData }) => { trackGAEvent({ ...gaData, type: label, - text: e.target.value, + text: PII_VALUE, }) } /> diff --git a/packages/app-rfi/src/components/steps/questions/FirstName.js b/packages/app-rfi/src/components/steps/questions/FirstName.js index 92e2029de2..cb5c7e7d0f 100644 --- a/packages/app-rfi/src/components/steps/questions/FirstName.js +++ b/packages/app-rfi/src/components/steps/questions/FirstName.js @@ -2,6 +2,7 @@ import React from "react"; import { gaEventPropTypes, trackGAEvent } from "../../../../../../shared"; import { RfiTextInput } from "../../controls"; +import { PII_VALUE } from "../../../core/utils/constants"; /** * @param {{ gaData: import("../../../../../../shared/services/googleAnalytics").GAEventObject}} props @@ -21,7 +22,7 @@ export const FirstName = ({ gaData }) => { trackGAEvent({ ...gaData, type: label, - text: e.target.value, + text: PII_VALUE, }) } /> diff --git a/packages/app-rfi/src/components/steps/questions/LastName.js b/packages/app-rfi/src/components/steps/questions/LastName.js index 68375bddc9..b40c0ec931 100644 --- a/packages/app-rfi/src/components/steps/questions/LastName.js +++ b/packages/app-rfi/src/components/steps/questions/LastName.js @@ -2,6 +2,7 @@ import React from "react"; import { gaEventPropTypes, trackGAEvent } from "../../../../../../shared"; import { RfiTextInput } from "../../controls"; +import { PII_VALUE } from "../../../core/utils/constants"; /** * @param {{ gaData: import("../../../../../../shared/services/googleAnalytics").GAEventObject}} props @@ -21,7 +22,7 @@ export const LastName = ({ gaData }) => { trackGAEvent({ ...gaData, type: label, - text: e.target.value, + text: PII_VALUE, }) } /> diff --git a/packages/app-rfi/src/components/steps/questions/Phone.js b/packages/app-rfi/src/components/steps/questions/Phone.js index 138950c9fe..a9ca95f51f 100644 --- a/packages/app-rfi/src/components/steps/questions/Phone.js +++ b/packages/app-rfi/src/components/steps/questions/Phone.js @@ -2,6 +2,7 @@ import React from "react"; import { gaEventPropTypes, trackGAEvent } from "../../../../../../shared"; import { RfiPhone } from "../../controls"; +import { PII_VALUE } from "../../../core/utils/constants"; /** * @param {{ gaData: import("../../../../../../shared/services/googleAnalytics").GAEventObject}} props @@ -21,7 +22,7 @@ export const Phone = ({ gaData }) => { trackGAEvent({ ...gaData, type: label, - text: e.target.value, + text: PII_VALUE, }) } /> diff --git a/packages/app-rfi/src/components/steps/questions/ZipCode.js b/packages/app-rfi/src/components/steps/questions/ZipCode.js index 3083b7fd00..e941b8afbc 100644 --- a/packages/app-rfi/src/components/steps/questions/ZipCode.js +++ b/packages/app-rfi/src/components/steps/questions/ZipCode.js @@ -1,7 +1,7 @@ import React, { useEffect } from "react"; import { gaEventPropTypes, trackGAEvent } from "../../../../../../shared"; -import { KEY } from "../../../core/utils/constants"; +import { KEY, PII_VALUE } from "../../../core/utils/constants"; import { useRfiContext } from "../../../core/utils/rfiContext"; import { RfiTextInput } from "../../controls"; @@ -42,7 +42,7 @@ export const ZipCode = ({ gaData }) => { trackGAEvent({ ...gaData, type: label, - text: e.target.value, + text: PII_VALUE, }) } /> diff --git a/packages/app-rfi/src/core/utils/constants.js b/packages/app-rfi/src/core/utils/constants.js index 3700ab7ddc..bc008a13c7 100644 --- a/packages/app-rfi/src/core/utils/constants.js +++ b/packages/app-rfi/src/core/utils/constants.js @@ -89,3 +89,7 @@ export const DATA_SOURCE = { ASU_ONLINE: "https://cms.asuonline.asu.edu/lead-submissions-v3.5/programs", COUNTRIES_STATES: "https://api.myasuplat-dpl.asu.edu/api/codeset/countries", }; + +// Personally Identifiable Information (PII) +// UDS-1943 : Fields containing PII should not send the PII to data layer +export const PII_VALUE = "REDACTED";