Merge pull request #922 from Safelite/feature/richardson/INSR-2119

updates to mimic fmg for experiment api updates
This commit is contained in:
brich1212safe 2025-01-30 14:58:30 -05:00 committed by GitHub
commit 1cdcaa7bd6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 5 deletions

View file

@ -422,14 +422,14 @@ async function runExperiments(nextPage) {
if (!store.applicationUser.triggeredSiteEntry) {
await store.runExperimentsForTrigger({
userId: getDeviceIdValue(),
deviceId: getDeviceIdValue(),
triggerEvent: experimentTriggers.SITE_ENTRY,
triggerValue: applicationConfig.SITE_ENTRY_TRIGGER_VALUE
});
}
await store.runExperimentsForTrigger({
userId: getDeviceIdValue(),
deviceId: getDeviceIdValue(),
triggerEvent: experimentTriggers.PAGE_ENTRY,
triggerValue: nextPage
});

View file

@ -17,7 +17,7 @@ import webStorageConstants from '@/constants/web-storage-constants';
// eslint-disable-next-line import/no-cycle
import globalMethods from '@/global-methods';
// eslint-disable-next-line import/no-cycle
import { getSessionKeyValue, getUserIdValue, deleteISSCookie } from '@/helpers/cookie-helper';
import { getSessionKeyValue, getUserIdValue, deleteISSCookie, getDeviceIdValue } from '@/helpers/cookie-helper';
import { convertDateStringToDate, getDateDifferenceInDays, militaryToTwelveHourTime } from '@/helpers/date-helper';
import { getExperimentSettingValue, getFeatureTogglesPayloadObject } from '@/helpers/experiment-helper';
import { findLineItemIndex, getLineItemsFlattened } from '@/helpers/line-items-helper';
@ -2453,6 +2453,7 @@ export const useMainStore = defineStore({
payload: {
experimentForLogging: {
userId: getUserIdValue(),
deviceId: getDeviceIdValue(),
experimentUniverseId: experiment.universeId,
experimentUniverseName: experiment.universeName,
experimentTestId: experiment.testId,
@ -2592,14 +2593,14 @@ export const useMainStore = defineStore({
});
},
async runExperimentsForTrigger({ userId, triggerEvent, triggerValue }) {
async runExperimentsForTrigger({ deviceId, triggerEvent, triggerValue }) {
if (triggerEvent === experimentTriggers.SITE_ENTRY) {
this.updateTriggeredSiteEntry(true);
}
const payload = {
applicationName: applicationConfig.APPLICATION_NAME,
userId,
deviceId,
triggerEvent,
triggerValue,
experimentOrder: this.experimentOrder