From e278bcc878b7e4869ace5fa1568a4a622221160e Mon Sep 17 00:00:00 2001 From: CarlNation Date: Sat, 18 Oct 2025 20:53:41 -0400 Subject: [PATCH] CASH-1637 CASH-1637 add useragent --- src/helpers/heritage-integration/cookie-helper.js | 11 +++++++++++ src/mixins/analytics-mixin.js | 7 ++++++- src/store/index.js | 4 ++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/helpers/heritage-integration/cookie-helper.js b/src/helpers/heritage-integration/cookie-helper.js index 6e78d1304..c9c0f4ff3 100644 --- a/src/helpers/heritage-integration/cookie-helper.js +++ b/src/helpers/heritage-integration/cookie-helper.js @@ -125,6 +125,17 @@ export function getSessionKeyValue() { return 0; } +export function getskeyValue() { + const cookieValue = getCookieValueByName(cookieNames.SESSION_KEY); + + if (cookieValue) { + return cookieValue; + } + + return 0; +} + + export function setSessionKeyIfUnset(value) { if (!isCookieSet(cookieNames.FUNNEL_SESSION_KEY)) { setCookieProperties( diff --git a/src/mixins/analytics-mixin.js b/src/mixins/analytics-mixin.js index fbaccb113..14ddd14c6 100644 --- a/src/mixins/analytics-mixin.js +++ b/src/mixins/analytics-mixin.js @@ -10,6 +10,7 @@ import { areAllSessionCookiesSet, setSessionIdIfUnset, setSessionKeyIfUnset, + getskeyValue, } from "@/helpers/heritage-integration/cookie-helper"; import { queryStrings } from "@/constants/query-strings"; import { experimentSettings, experimentUniverses } from "@/constants/experiments"; @@ -231,11 +232,14 @@ export default { (part) => `${part.glassLocation}-${part.glassName}` ); + var appointment = `${order?.schedule?.date ?? ""} ${order?.schedule?.startTime ?? ""}`; + var sessionData = {}; sessionData.currentPage = getPageNameFromRouter(); sessionData.sid = getSessionIdValue(); sessionData.deviceId = getDeviceIdValue(); sessionData.fmgSessionId = applicationUser?.savedSessionId; + sessionData.skey = getskeyValue().toString(); sessionData.userId = getUserIdValue(); sessionData.carId = order?.vehicle?.carId; sessionData.vehicleYear = order?.vehicle?.year; @@ -266,7 +270,7 @@ export default { sessionData.providerCtu = order?.serviceLocation?.provider?.address?.zipCodeCtu ? order?.serviceLocation?.provider?.address?.zipCodeCtu : order?.serviceLocation?.zipCodeCtu; - sessionData.appointmentDate = `${order?.schedule?.date} ${order?.schedule?.startTime}`; + sessionData.appointmentDate = appointment; sessionData.serviceType = order?.serviceLocation?.appointmentType; sessionData.promoCodes = promoCodes; sessionData.hasTechnicianNotes = order?.serviceLocation?.techNotes ? true : false; @@ -280,6 +284,7 @@ export default { sessionData.isItac = order?.policy?.isItac; sessionData.subTotalPrice = getSubTotal(order?.lineItems); sessionData.totalPrice = getAmountDue(order?.lineItems, true); + sessionData.userAgent = navigator.userAgent; await baseMixin.methods.dispatchStoreAction( storeActions.LOG_FMG_SESSION_DATA, diff --git a/src/store/index.js b/src/store/index.js index 991391e38..e50a33765 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1601,6 +1601,7 @@ export const actions = { sid, deviceId, fmgSessionId, + skey, userId, carId, vehicleYear, @@ -1639,6 +1640,7 @@ export const actions = { isItac, subTotalPrice, totalPrice, + userAgent, } ) { var payload = { @@ -1646,6 +1648,7 @@ export const actions = { sid: sid, deviceId: deviceId, fmgSessionId: fmgSessionId, + skey: skey, userId: userId, carId: carId, vehicleYear: vehicleYear, @@ -1684,6 +1687,7 @@ export const actions = { isItac: isItac, subTotalPrice: subTotalPrice, totalPrice: totalPrice, + userAgent, }; return globalMethods.callHttpClient({