Merge pull request #2894 from Safelite/nation/CASH-1637-revert

CASH-1637
This commit is contained in:
CarlNation 2025-10-18 10:19:31 -04:00 committed by GitHub
commit 6e9a554f0b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 0 additions and 73 deletions

View file

@ -7,8 +7,6 @@ const analyticsPageEvents = {
const GaEvents = {
GENERIC_EVENT: "event",
PAGE_VIEW_EVENT: "logPageview",
FMG_DATA_EVENT_1: "logEvent1",
FMG_DATA_EVENT_2: "logEvent2",
};
const GaCategories = {
@ -16,7 +14,6 @@ const GaCategories = {
EVOX: "Evox",
APPOINTMENT: "Appointment",
SERVICE_LOCATION: "service-location",
FMG_SESSION_DATA: "fmg_session_data",
};
const GaActions = {

View file

@ -200,73 +200,6 @@ export default {
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() {
// helper check for if an object is defined (but maybe falsey)
const isDefined = (x) => x !== null && x !== undefined;

View file

@ -12,7 +12,4 @@ export async function afterEach(to, from) {
// Push current order status to Data Layer
analyticsMixin.methods.pushOrderToDataLayer();
// Push session data GA events for Analytics
analyticsMixin.methods.pushFmgDataToGA();
}