CSR-1529
zipcode GA event
This commit is contained in:
parent
802e8f3e3e
commit
d4db6c821c
3 changed files with 37 additions and 6 deletions
|
|
@ -12,6 +12,7 @@ const GaEvents = {
|
|||
const GaCategories = {
|
||||
API_RESPONSE: "Api_Response",
|
||||
EVOX: "Evox",
|
||||
FUNNEL_ENTRY: "funnel_entry",
|
||||
};
|
||||
|
||||
const GaActions = {
|
||||
|
|
@ -20,6 +21,7 @@ const GaActions = {
|
|||
VIF: "vif",
|
||||
SUBMITTED: "Submitted",
|
||||
DISPLAYED: "Displayed",
|
||||
ZIP_CODE_PROVIDED: "zip_code_provided",
|
||||
};
|
||||
|
||||
const GaLabels = {
|
||||
|
|
@ -27,7 +29,7 @@ const GaLabels = {
|
|||
ERROR: "Error",
|
||||
LICENSE_PLATE_LOOKUP: "License_Plate_Look_Up",
|
||||
VIN_LOOKUP: "Vin_Look_Up",
|
||||
ADDRESS_LOOKUP: "Address_Look_up",
|
||||
ADDRESS_LOOKUP: "Address_Look_up",
|
||||
};
|
||||
|
||||
const ValueToLogTypes = {
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ import { getFunnelCookie } from "@/helpers/heritage-integration/cookie-helper";
|
|||
|
||||
import store from "@/store";
|
||||
import baseMixin from "@/mixins/base-mixin";
|
||||
|
||||
import { queryStrings } from "@/constants/query-strings";
|
||||
// DEFINE VALIDATION RULES
|
||||
defineRule("replace-options-required", required(errorMessages.REPLACE_OPTIONS_REQUIRED));
|
||||
|
||||
|
|
@ -90,9 +90,22 @@ export default {
|
|||
async beforeRouteEnter(to, from, next) {
|
||||
// Call APIs
|
||||
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
|
||||
const queryString = window.location.search;
|
||||
const urlParams = new URLSearchParams(queryString);
|
||||
const lowerCaseParams = new URLSearchParams();
|
||||
for (const [name, value] of urlParams) {
|
||||
lowerCaseParams.append(name.toLowerCase(), value);
|
||||
}
|
||||
|
||||
const zip = lowerCaseParams.get(queryStrings.ZIP_CODE)
|
||||
? lowerCaseParams.get(queryStrings.ZIP_CODE)
|
||||
: store.getters.order.serviceLocation.zipCode;
|
||||
|
||||
const damageOptionsPromise = baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.GET_DAMAGE_OPTIONS,
|
||||
{ carId: store.getters.vehicle.carId }
|
||||
{ carId: store.getters.vehicle.carId,
|
||||
zipCode:zip,
|
||||
}
|
||||
);
|
||||
|
||||
// Settle promises and get results
|
||||
|
|
@ -122,7 +135,7 @@ export default {
|
|||
);
|
||||
vm.$refs.backGlassOptions.initializeComponent(
|
||||
resultMap.damageOptions.backGlassOptions.availableReplacementOptions
|
||||
);
|
||||
);
|
||||
});
|
||||
},
|
||||
data() {
|
||||
|
|
@ -134,7 +147,8 @@ export default {
|
|||
selectedPassengerSideReplaceOptions: this.getPassengerSideReplaceOptionsFromStore(),
|
||||
},
|
||||
selectedWindshieldOptions: this.getWindshieldOptionsFromStore(),
|
||||
selectedRearReplaceOptions: this.getRearReplaceOptionsFromStore(),
|
||||
selectedRearReplaceOptions: this.getRearReplaceOptionsFromStore(),
|
||||
serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipcode,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -156,9 +170,21 @@ export default {
|
|||
this.$store.getters.vehicle.carId,
|
||||
true
|
||||
);
|
||||
}
|
||||
if(this.serviceZipCode){
|
||||
this.pushEventToGA(
|
||||
this.GaCategories.FUNNEL_ENTRY,
|
||||
this.GaActions.ZIP_CODE_PROVIDED,
|
||||
this.serviceZipCode,
|
||||
true
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
getZipFromStore() {
|
||||
return this.$store.getters.order.serviceLocation.zipCode;
|
||||
},
|
||||
|
||||
backButtonAction() {
|
||||
// route to move backwards
|
||||
this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route);
|
||||
|
|
@ -415,6 +441,7 @@ export default {
|
|||
|
||||
return selectedGlassToReplace;
|
||||
},
|
||||
|
||||
},
|
||||
computed: {
|
||||
isWindshieldDamageLocation() {
|
||||
|
|
|
|||
|
|
@ -740,11 +740,13 @@ export const actions = {
|
|||
});
|
||||
},
|
||||
|
||||
getDamageOptions(context, { carId }) {
|
||||
getDamageOptions(context, { carId,zipCode }) {
|
||||
return globalMethods.callHttpClient({
|
||||
methods: endpoints.GetDamageOptions.method,
|
||||
endpoint: `${endpoints.GetDamageOptions.url}/${carId}`,
|
||||
payload: {},
|
||||
additionalSuccessEventDataHandler: (response) =>
|
||||
"QueryStringZip: " + zipCode,
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue