Merge branch 'release/2025.10.23' into nation/CASH-1426
This commit is contained in:
commit
b6909c19ea
3 changed files with 0 additions and 73 deletions
|
|
@ -7,8 +7,6 @@ const analyticsPageEvents = {
|
||||||
const GaEvents = {
|
const GaEvents = {
|
||||||
GENERIC_EVENT: "event",
|
GENERIC_EVENT: "event",
|
||||||
PAGE_VIEW_EVENT: "logPageview",
|
PAGE_VIEW_EVENT: "logPageview",
|
||||||
FMG_DATA_EVENT_1: "logEvent1",
|
|
||||||
FMG_DATA_EVENT_2: "logEvent2",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const GaCategories = {
|
const GaCategories = {
|
||||||
|
|
@ -16,7 +14,6 @@ const GaCategories = {
|
||||||
EVOX: "Evox",
|
EVOX: "Evox",
|
||||||
APPOINTMENT: "Appointment",
|
APPOINTMENT: "Appointment",
|
||||||
SERVICE_LOCATION: "service-location",
|
SERVICE_LOCATION: "service-location",
|
||||||
FMG_SESSION_DATA: "fmg_session_data",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const GaActions = {
|
const GaActions = {
|
||||||
|
|
|
||||||
|
|
@ -200,73 +200,6 @@ export default {
|
||||||
await this.logPageView(analyticsPageEvents.ENTRY);
|
await this.logPageView(analyticsPageEvents.ENTRY);
|
||||||
},
|
},
|
||||||
|
|
||||||
async pushFmgDataToGA() {
|
|
||||||
const hasSubmittedOrder = baseMixin.methods.hasSubmittedOrder();
|
|
||||||
const submittedOrder = baseMixin.methods.getSubmittedOrder();
|
|
||||||
const order = hasSubmittedOrder ? submittedOrder : store.getters.order;
|
|
||||||
|
|
||||||
//event 1
|
|
||||||
var label = {};
|
|
||||||
label.carId = order?.vehicle?.carId;
|
|
||||||
label.hasVin = order?.vehicle?.vin ? true : false;
|
|
||||||
label.cashOrInsuranceAccountType = order?.payment?.isInsurance ? "Insurance" : "Cash";
|
|
||||||
label.damageType = order?.damage?.isRepair ? "Repair" : "Replace";
|
|
||||||
label.productType = order?.damage?.glassToReplace;
|
|
||||||
label.recalRequired = containsRecalParts(order?.lineItems);
|
|
||||||
label.recalType = getRecalPartNumbers(order?.lineItems?.glassParts);
|
|
||||||
label.serviceZipCode = order?.serviceLocation?.provider?.address?.zipCode
|
|
||||||
? order?.serviceLocation?.provider?.address?.zipCode
|
|
||||||
: order?.serviceLocation?.zipCode;
|
|
||||||
label.providerCtu = order?.serviceLocation?.provider?.address?.zipCodeCtu
|
|
||||||
? order?.serviceLocation?.provider?.address?.zipCodeCtu
|
|
||||||
: order?.serviceLocation?.zipCodeCtu;
|
|
||||||
label.subTotalPrice = getSubTotal(order?.lineItems);
|
|
||||||
label.totalPrice = getAmountDue(order?.lineItems, true);
|
|
||||||
|
|
||||||
await this.pushEventToGA(
|
|
||||||
GaCategories.FMG_SESSION_DATA,
|
|
||||||
GaEvents.FMG_DATA_EVENT_1,
|
|
||||||
JSON.stringify(label),
|
|
||||||
true,
|
|
||||||
null,
|
|
||||||
null
|
|
||||||
);
|
|
||||||
|
|
||||||
//event 2
|
|
||||||
const isEarlyBird = order?.lineItems?.supportingItems?.find(
|
|
||||||
(lineItem) => lineItem.partType == partTypeStrings.EARLY_BIRD
|
|
||||||
);
|
|
||||||
|
|
||||||
const promoCodes = Array.isArray(order?.lineItems?.promos)
|
|
||||||
? order?.lineItems?.promos
|
|
||||||
.map((item) => item.promoCode)
|
|
||||||
.filter((code) => code)
|
|
||||||
.join(", ")
|
|
||||||
: "";
|
|
||||||
|
|
||||||
label = {};
|
|
||||||
label.serviceType = order?.serviceLocation?.appointmentType;
|
|
||||||
label.promoCodes = promoCodes;
|
|
||||||
label.hasTechnicianNotes = order?.serviceLocation?.techNotes ? true : false;
|
|
||||||
label.paymentMethod = order?.payment?.piaType;
|
|
||||||
label.isTextingOptedIn = order?.customer?.isSmsOptIn ? true : false;
|
|
||||||
label.isEarlyBird = isEarlyBird ? true : false;
|
|
||||||
label.insuranceCo = order?.policy?.insuranceCompanyName;
|
|
||||||
label.deductible = order?.policy?.currentDeductible;
|
|
||||||
label.isVerified = order?.payment?.insuranceCoverage?.isVerified;
|
|
||||||
label.isNoComp = order?.policy?.isNoComp;
|
|
||||||
label.isItac = order?.policy?.isItac;
|
|
||||||
|
|
||||||
await this.pushEventToGA(
|
|
||||||
GaCategories.FMG_SESSION_DATA,
|
|
||||||
GaEvents.FMG_DATA_EVENT_2,
|
|
||||||
JSON.stringify(label),
|
|
||||||
true,
|
|
||||||
null,
|
|
||||||
null
|
|
||||||
);
|
|
||||||
},
|
|
||||||
|
|
||||||
pushOrderToDataLayer() {
|
pushOrderToDataLayer() {
|
||||||
// helper check for if an object is defined (but maybe falsey)
|
// helper check for if an object is defined (but maybe falsey)
|
||||||
const isDefined = (x) => x !== null && x !== undefined;
|
const isDefined = (x) => x !== null && x !== undefined;
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,4 @@ export async function afterEach(to, from) {
|
||||||
|
|
||||||
// Push current order status to Data Layer
|
// Push current order status to Data Layer
|
||||||
analyticsMixin.methods.pushOrderToDataLayer();
|
analyticsMixin.methods.pushOrderToDataLayer();
|
||||||
|
|
||||||
// Push session data GA events for Analytics
|
|
||||||
analyticsMixin.methods.pushFmgDataToGA();
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue