Auto stash before merge of "develop" and "origin/develop"
This commit is contained in:
parent
52b83d9244
commit
c0290c43ee
9 changed files with 64 additions and 4 deletions
|
|
@ -52,6 +52,7 @@ import listButtonHorizontal from "@/ux-components/list-button-horizontal/list-bu
|
||||||
import listCard from "@/ux-components/list-card/list-card";
|
import listCard from "@/ux-components/list-card/list-card";
|
||||||
import { ErrorMessage } from 'vee-validate';
|
import { ErrorMessage } from 'vee-validate';
|
||||||
import radio from "@/ux-components/radio/radio";
|
import radio from "@/ux-components/radio/radio";
|
||||||
|
import { queryStrings } from "@/constants/query-strings";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "buttonQuestion",
|
name: "buttonQuestion",
|
||||||
|
|
@ -133,6 +134,8 @@ export default {
|
||||||
return answer.Name ? answer.Name : answer;
|
return answer.Name ? answer.Name : answer;
|
||||||
},
|
},
|
||||||
handleCheckedChanged(val) {
|
handleCheckedChanged(val) {
|
||||||
|
this.pushEventToGA(this.$route.query[queryStrings.FMG_PAGE], 'Clicked', val.value, undefined, this.$route.query[queryStrings.FMG_PAGE]);
|
||||||
|
|
||||||
if(this.isMultiSelect && this.selectedValues) {
|
if(this.isMultiSelect && this.selectedValues) {
|
||||||
// Add or remove item to array of data to emit
|
// Add or remove item to array of data to emit
|
||||||
const newSelectedValues = this.selectedValues;
|
const newSelectedValues = this.selectedValues;
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,10 @@ const endpoints = {
|
||||||
LogActivity:{
|
LogActivity:{
|
||||||
url: "/analytics/api/v1/analytics/activity",
|
url: "/analytics/api/v1/analytics/activity",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
},
|
||||||
|
GetExperimentsByUserForGa: {
|
||||||
|
url: "/analytics/api/v1/analytics/get-experiments-for-GA",
|
||||||
|
method: "GET",
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
const experimentUniverses = {
|
const experimentUniverses = {
|
||||||
CONCEPT_FUNNEL: 'ConceptFunnel'
|
CONCEPT_FUNNEL: 'ConceptFunnel'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const experimentSettings = {
|
||||||
|
GOOGLE_CUSTOM_DIMENSION_INDEX: 'Google Custom Dimension Index'
|
||||||
|
}
|
||||||
|
|
||||||
export { experimentUniverses };
|
export { experimentUniverses, experimentSettings};
|
||||||
|
|
||||||
|
|
@ -19,6 +19,7 @@ const storeActions = {
|
||||||
VALIDATE_ZIP: "validateZip",
|
VALIDATE_ZIP: "validateZip",
|
||||||
LOG_EXPERIMENT_EXPOSURE: "logExperimentExposure",
|
LOG_EXPERIMENT_EXPOSURE: "logExperimentExposure",
|
||||||
LOG_ACTIVITY: "logActivity",
|
LOG_ACTIVITY: "logActivity",
|
||||||
|
GET_EXPERIMENTS_BY_USER_FOR_GA: "getExperimentsByUserForGa",
|
||||||
|
|
||||||
// DEPENDENCY MUTATIONS
|
// DEPENDENCY MUTATIONS
|
||||||
RESET_VEHICLE_STATE_AND_DEPENDENCIES: "resetVehicleAndDependencies",
|
RESET_VEHICLE_STATE_AND_DEPENDENCIES: "resetVehicleAndDependencies",
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,11 @@ import httpStatusCodes from "http-status-codes";
|
||||||
export default {
|
export default {
|
||||||
callHttpClient({ method, endpoint, payload }) {
|
callHttpClient({ method, endpoint, payload }) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const apiGatewayUrl = applicationConfig.CONSUMER_APIGATEWAY_URL;
|
var apiGatewayUrl = applicationConfig.CONSUMER_APIGATEWAY_URL;
|
||||||
|
|
||||||
|
if(endpoint.includes('analytics')){
|
||||||
|
apiGatewayUrl = 'https://localhost:44324';
|
||||||
|
}
|
||||||
|
|
||||||
const payloadAndAnalyticsData = Object.assign({}, payload, {
|
const payloadAndAnalyticsData = Object.assign({}, payload, {
|
||||||
AppName: "FixMyGlass",
|
AppName: "FixMyGlass",
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,7 @@ import { errorMessages } from "@/constants/error-messages";
|
||||||
import { damageLocationsCms } from "@/constants/damage-locations-cms.js";
|
import { damageLocationsCms } from "@/constants/damage-locations-cms.js";
|
||||||
import { damageLocationsSelected } from "@/constants/damage-locations-selected.js";
|
import { damageLocationsSelected } from "@/constants/damage-locations-selected.js";
|
||||||
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
||||||
|
import { queryStrings } from "@/constants/query-strings";
|
||||||
|
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import baseMixin from "@/mixins/base-mixin";
|
import baseMixin from "@/mixins/base-mixin";
|
||||||
|
|
@ -140,6 +141,11 @@ export default {
|
||||||
selectedRearReplaceOptions: this.getRearReplaceOptionsFromStore(),
|
selectedRearReplaceOptions: this.getRearReplaceOptionsFromStore(),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted(){
|
||||||
|
if(this.$store.getters.vehicle.imageVifNumber){
|
||||||
|
this.pushEventToGA("Evox", `vif_${this.$store.getters.vehicle.imageVifNumber}`, this.$store.getters.vehicle.carId, undefined, this.$route.query[queryStrings.FMG_PAGE]);
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
if(store.getters.vehicle.carId){
|
if(store.getters.vehicle.carId){
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import { settleAllPromises } from "@/helpers/layout-helper";
|
||||||
import { getDeviceIdValue, getSessionIdValue, getSessionKeyValue } from "@/helpers/heritage-integration/cookie-helper";
|
import { getDeviceIdValue, getSessionIdValue, getSessionKeyValue } from "@/helpers/heritage-integration/cookie-helper";
|
||||||
import { queryStrings } from "@/constants/query-strings";
|
import { queryStrings } from "@/constants/query-strings";
|
||||||
import { analyticsPageEvents } from "@/constants/analytics-page-events";
|
import { analyticsPageEvents } from "@/constants/analytics-page-events";
|
||||||
|
import { experimentSettings } from "@/constants/experiments";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -52,6 +53,29 @@ export default {
|
||||||
};
|
};
|
||||||
|
|
||||||
pushToDataLayerIfDefined(pageViewEvent);
|
pushToDataLayerIfDefined(pageViewEvent);
|
||||||
|
},
|
||||||
|
|
||||||
|
pushExperimentsToDataLayer(experiments){
|
||||||
|
experiments?.data?.forEach(exp => {
|
||||||
|
|
||||||
|
// Set Google Dimension Index based on experiment settings.
|
||||||
|
let googleDimensionIndex = 99;
|
||||||
|
|
||||||
|
if (exp.settings[experimentSettings.GOOGLE_CUSTOM_DIMENSION_INDEX] !== undefined) {
|
||||||
|
googleDimensionIndex = exp.settings[experimentSettings.GOOGLE_CUSTOM_DIMENSION_INDEX];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create object with dimension index and value.
|
||||||
|
const experimentWithDimension = {};
|
||||||
|
|
||||||
|
Object.keys(exp).forEach(key => {
|
||||||
|
experimentWithDimension[`${key}_${googleDimensionIndex}`] = exp[key];
|
||||||
|
});
|
||||||
|
|
||||||
|
// Push to the data layer with the Google Custom Dimension Index.
|
||||||
|
pushToDataLayerIfDefined(experimentWithDimension);
|
||||||
|
});
|
||||||
|
},
|
||||||
this.logEvent(pageName, analyticsPageEvents.ENTRY);
|
this.logEvent(pageName, analyticsPageEvents.ENTRY);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ import { lazyLoadComponent } from "@/router/dynamic-routing/component-loader.js"
|
||||||
import { routingTable } from "@/router/router-constants/routing-table.js";
|
import { routingTable } from "@/router/router-constants/routing-table.js";
|
||||||
import { globalEvents, globalEventTypes } from "@/constants/events";
|
import { globalEvents, globalEventTypes } from "@/constants/events";
|
||||||
import { queryStrings } from "@/constants/query-strings";
|
import { queryStrings } from "@/constants/query-strings";
|
||||||
|
import { analyticsPageEvents } from "./router-constants/analytics-page-events";
|
||||||
|
import { getDeviceIdValue } from "@/helpers/heritage-integration/cookie-helper";
|
||||||
|
|
||||||
// Heritage integration
|
// Heritage integration
|
||||||
import { isSavedSessionStillActive } from "@/helpers/heritage-integration/session-helper";
|
import { isSavedSessionStillActive } from "@/helpers/heritage-integration/session-helper";
|
||||||
|
|
@ -21,6 +23,7 @@ import analyticsMixin from "@/mixins/analytics-mixin";
|
||||||
import ComponentTest from "@/layouts/component-test/component-test.vue";
|
import ComponentTest from "@/layouts/component-test/component-test.vue";
|
||||||
import FormTest from "@/layouts/form-test/form-test.vue";
|
import FormTest from "@/layouts/form-test/form-test.vue";
|
||||||
|
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
{
|
{
|
||||||
path: "/component-test", // This is a temporary route for testing.
|
path: "/component-test", // This is a temporary route for testing.
|
||||||
|
|
@ -121,8 +124,11 @@ const router = createRouter({
|
||||||
|
|
||||||
//---------------------------------------------------------- Router Functions ----------------------------------------------------------
|
//---------------------------------------------------------- Router Functions ----------------------------------------------------------
|
||||||
|
|
||||||
router.afterEach((to, from) => {
|
router.afterEach(async (to, from) => {
|
||||||
|
// Push page view to GA
|
||||||
analyticsMixin.methods.pushPageViewToGA(to.query[queryStrings.FMG_PAGE]);
|
analyticsMixin.methods.pushPageViewToGA(to.query[queryStrings.FMG_PAGE]);
|
||||||
|
const assignedExperiments = await baseMixin.methods.dispatchNonBlockingStoreAction(storeActions.GET_EXPERIMENTS_BY_USER_FOR_GA, { userId: getDeviceIdValue() });
|
||||||
|
analyticsMixin.methods.pushExperimentsToDataLayer(assignedExperiments);
|
||||||
});
|
});
|
||||||
|
|
||||||
router.navigate = (scenario, currentRoute, optionalQuery = {}, optionalParams = {}, optionalPageData = {}) => {
|
router.navigate = (scenario, currentRoute, optionalQuery = {}, optionalParams = {}, optionalPageData = {}) => {
|
||||||
|
|
@ -167,7 +173,7 @@ async function navigate(scenario, currentRoute, invalidateOnSave, optionalQuery
|
||||||
if (getFunnelCookie()?.ReferralNumber && getFunnelCookie()?.ReferralDate) {
|
if (getFunnelCookie()?.ReferralNumber && getFunnelCookie()?.ReferralDate) {
|
||||||
await saveOrder();
|
await saveOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
router.push({
|
router.push({
|
||||||
name: "root",
|
name: "root",
|
||||||
query: Object.assign(optionalQuery, {
|
query: Object.assign(optionalQuery, {
|
||||||
|
|
|
||||||
|
|
@ -445,6 +445,14 @@ export const actions = {
|
||||||
payload: payload
|
payload: payload
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getExperimentsByUserForGa(context, { userId }){
|
||||||
|
return globalMethods.callHttpClient({
|
||||||
|
method: endpoints.GetExperimentsByUserForGa.method,
|
||||||
|
endpoint: `${endpoints.GetExperimentsByUserForGa.url}/${userId}`,
|
||||||
|
payload: {}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
// Parts API Actions
|
// Parts API Actions
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue