INSR-8881: Add events to coverage-statement

This commit is contained in:
Alex Humphries 2026-04-03 10:44:31 -04:00
parent 66ba4498fe
commit 5dcb2dc63d
6 changed files with 106 additions and 13 deletions

View file

@ -30,6 +30,7 @@ export default {
default: 'RecalModal'
}
},
emits: ['recal-modal-opened'],
computed: {
modalBodyText() {
return this.getCmsContent(this.cmsWidgetName, 'BodyText').replaceAll('{custom:vehicleMake}', this.vehicleMake);
@ -50,6 +51,7 @@ export default {
methods: {
openModal() {
this.$refs.recalModal.openModal();
this.$emit('recal-modal-opened');
},
footerButtonClick() {
this.$refs.recalModal.closeModal();

View file

@ -109,7 +109,8 @@ describe('coverageStatement.vue', () => {
const mainInitialState = {
order: {
damage: {
isRepair: true
isRepair: true,
numberOfChips: 2
},
insuranceCoverage: {
coverageStatus: coverageStatuses.PENDING,
@ -606,7 +607,8 @@ describe('coverageStatement.vue', () => {
const mainInitialState = {
order: {
damage: {
isRepair: true
isRepair: true,
numberOfChips: 2
},
insuranceCoverage: {
coverageStatus: coverageStatuses.PENDING,
@ -636,7 +638,8 @@ describe('coverageStatement.vue', () => {
const mainInitialState = {
order: {
damage: {
isRepair: true
isRepair: true,
numberOfChips: 2
},
insuranceCoverage: {
coverageStatus: coverageStatuses.VERIFIED,
@ -665,7 +668,8 @@ describe('coverageStatement.vue', () => {
const mainInitialState = {
order: {
damage: {
isRepair: true
isRepair: true,
numberOfChips: 2
},
insuranceCoverage: {
coverageStatus: coverageStatuses.VERIFIED,
@ -697,7 +701,8 @@ describe('coverageStatement.vue', () => {
const mainInitialState = {
order: {
damage: {
isRepair: true
isRepair: true,
numberOfChips: 2
},
insuranceCoverage: {
coverageStatus: coverageStatuses.VERIFIED,
@ -724,7 +729,8 @@ describe('coverageStatement.vue', () => {
const mainInitialState = {
order: {
damage: {
isRepair: true
isRepair: true,
numberOfChips: 2
},
insuranceCoverage: {
coverageStatus: coverageStatuses.VERIFIED,
@ -755,7 +761,8 @@ describe('coverageStatement.vue', () => {
const mainInitialState = {
order: {
damage: {
isRepair: true
isRepair: true,
numberOfChips: 2
},
insuranceCoverage: {
coverageStatus: coverageStatuses.VERIFIED,

View file

@ -103,14 +103,16 @@
</div>
<recalModal
:ref="RECAL_MODAL_REF_NAME"
cmsWidgetName="RecalModal" />
cmsWidgetName="RecalModal"
@recalModalOpened="handleRecalModalOpened" />
<cancelClaimModal
:ref="CANCEL_CLAIM_REF_NAME"
@cancelClaimConfirmation="cancelClaim"
@returnToClaim="navigateForward" />
<oemEndorsementModal
:ref="OEM_ENDORSEMENT_REF_NAME"
cmsWidgetName="OEMEndorsementModal" />
cmsWidgetName="OEMEndorsementModal"
@oemEndorsementModalOpened="handleOemEndorsementModalOpened" />
</Form>
</template>
@ -374,6 +376,71 @@ export default {
setupModalLinks(this);
},
methods: {
logEventsToGA() {
const clientName = this.mainStore.accountNameForEvents;
if (this.isDeductibleVisible || this.isITACQuoteVisible) {
this.pushEventToGA('coverage', 'Yes', clientName, true, null, '1');
if (this.isITACQuoteVisible) {
this.pushEventToGA('Coverage', 'ITAC', `${this.deductibleValue}_${this.totalServicePrice}`, true);
}
else {
this.pushEventToGA('coverage', 'full_comprehensive', clientName, true);
this.pushEventToGA('coverage', 'deductible', this.deductibleValue.toString(), true);
}
}
else {
this.pushEventToGA('coverage', 'No', clientName, true, null, '0');
if (this.isNoCompQuoteVisible) {
this.pushEventToGA('coverage', 'no_comprehensive', `${this.totalServicePrice}`, true);
this.pushEventToGA('coverage', 'deductible', '9999', true);
}
else {
this.pushEventToGA('coverage', 'deductible', '7777', true);
}
}
if (this.mainStore.hasOemEndorsement) {
this.pushEventToGA('oem_endorsement', 'displayed', 'Yes', true, null, '1');
}
else {
this.pushEventToGA('oem_endorsement', 'displayed', 'No', true, null, '0');
}
if (this.isADAS) {
if (this.mainStore.vehicle.canSafeliteService) {
this.pushEventToGA('ADAS_self_service', 'ADAS_servicable_status', 'yes', true);
if (this.mainStore.hasRecalibrationPart) {
if (this.isDeductibleVisible) {
const recalibrationType = this.mainStore.lineItems.glassParts.find((part) => part.requiresRecalibration).recalibrationType;
if (this.deductibleValue <= 0) {
this.pushEventToGA('recalibration_opportunity_verified_0_deductible', this.mainStore.vehicle.carId, `recal_type_${recalibrationType}`, true);
}
else {
this.pushEventToGA('recalibration_opportunity_verified_over_0_deductible', this.mainStore.vehicle.carId, `recal_type_${recalibrationType}`, true);
}
}
else {
let appointmentType = '';
if (this.isITACQuoteVisible) {
appointmentType = 'ITAC';
}
else if (this.isNoCompQuoteVisible) {
appointmentType = 'no_comp';
}
else {
appointmentType = 'unverified';
}
this.pushEventToGA(`recalibration_opportunity_${appointmentType}`, this.mainStore.vehicle.carId, `recal_type_${this.mainStore.lineItems.glassParts.find((part) => part.requiresRecalibration).recalibrationType}`, true);
}
}
}
else {
this.pushEventToGA('ADAS_self_service', 'ADAS_servicable_status', 'no', true);
}
}
},
arePagePrerequisitesValid() {
return !!useMainStore().vehicle.carId;
},
@ -393,6 +460,8 @@ export default {
}
}
this.logEventsToGA();
showIssLoadingModal(false);
this.isPageLoading = false;
},
@ -410,8 +479,13 @@ export default {
}
},
async navigateForward() {
showIssLoadingModal(true);
if (this.isUnverifiedVisible || this.isDeductibleVisible) {
if (this.isUnverifiedVisible || this.isDeductibleVisible) {
if (this.isRepair) {
this.pushEventToGA('RepairDamage', 'Repair', this.mainStore.damage.numberOfChips.toString(), true, null, '1');
}
else {
this.pushEventToGA('RepairDamage', 'Replacement', 'Replacement', true, null, '1');
}
this.navigateWithScenario(navigationScenarios.CLICKED_FORWARD);
} else if (this.isITACQuoteVisible || this.isNoCompQuoteVisible) {
this.mainStore.updateIsSafeliteProvider(true);
@ -475,7 +549,13 @@ export default {
cancelClaim() {
this.mainStore.updateIsSafeliteProvider(false);
this.$router.navigateBailout(bailoutMessage.CoverageCancelledByUser());
}
},
handleRecalModalOpened() {
this.pushEventToGA('recalibration_modal', 'learn_more_clicked', this.mainStore.vehicle.carId, true);
},
handleOemEndorsementModalOpened() {
this.pushEventToGA('oem_endorsement_modal', 'clicked', 'Yes', true, null, '1');
},
}
};
</script>

View file

@ -26,6 +26,7 @@ export default {
default: 'OEMEndorsementModal'
}
},
emits: ['oem-endorsement-modal-opened'],
computed: {
modalBodyText() {
return this.getCmsContent(this.cmsWidgetName, 'BodyText');
@ -40,6 +41,7 @@ export default {
methods: {
openModal() {
this.$refs.oemEndorsementModal.openModal();
this.$emit('oem-endorsement-modal-opened');
},
footerButtonClick() {
this.$refs.oemEndorsementModal.closeModal();

View file

@ -193,7 +193,7 @@ export default {
appointmentType: serviceLocation.appointmentType,
providerAddress: serviceLocation?.provider?.address,
customerPortalLoginToken,
carrierName: issConfig.clientName,
carrierName: issConfig.clientDisplayName,
carrierUrl: issConfig.successReturnURL,
isRepair: damage.isRepair,
hasRecalibrationPart,

View file

@ -96,6 +96,8 @@ export default {
const currentPageName = this.getPageNameByQueryString();
const labelToLog = getValueToLog(label, valueToLogType);
console.log(`Pushing event to GA: category=${category}, action=${action}, label=${labelToLog}, value=${value}, page=${currentPageName}`);
const eventToBePushed = {
event: GaEvents.GENERIC_EVENT,
category,