Merge pull request #1168 from Safelite/feature/humphries/INSR-8881

INSR-8881: Add events to coverage-statement
This commit is contained in:
AHumphriesSL 2026-04-03 13:51:20 -04:00 committed by GitHub
commit 5e6c1ba395
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 104 additions and 12 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

@ -115,7 +115,8 @@ describe('coverageStatement.vue', () => {
const mainInitialState = {
order: {
damage: {
isRepair: true
isRepair: true,
numberOfChips: 2
},
insuranceCoverage: {
coverageStatus: coverageStatuses.PENDING,
@ -614,7 +615,8 @@ describe('coverageStatement.vue', () => {
const mainInitialState = {
order: {
damage: {
isRepair: true
isRepair: true,
numberOfChips: 2
},
insuranceCoverage: {
coverageStatus: coverageStatuses.PENDING,
@ -644,7 +646,8 @@ describe('coverageStatement.vue', () => {
const mainInitialState = {
order: {
damage: {
isRepair: true
isRepair: true,
numberOfChips: 2
},
insuranceCoverage: {
coverageStatus: coverageStatuses.VERIFIED,
@ -673,7 +676,8 @@ describe('coverageStatement.vue', () => {
const mainInitialState = {
order: {
damage: {
isRepair: true
isRepair: true,
numberOfChips: 2
},
insuranceCoverage: {
coverageStatus: coverageStatuses.VERIFIED,
@ -705,7 +709,8 @@ describe('coverageStatement.vue', () => {
const mainInitialState = {
order: {
damage: {
isRepair: true
isRepair: true,
numberOfChips: 2
},
insuranceCoverage: {
coverageStatus: coverageStatuses.VERIFIED,
@ -732,7 +737,8 @@ describe('coverageStatement.vue', () => {
const mainInitialState = {
order: {
damage: {
isRepair: true
isRepair: true,
numberOfChips: 2
},
insuranceCoverage: {
coverageStatus: coverageStatuses.VERIFIED,
@ -763,7 +769,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>
@ -377,6 +379,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;
},
@ -396,6 +463,8 @@ export default {
}
}
this.logEventsToGA();
showIssLoadingModal(false);
this.isPageLoading = false;
},
@ -414,7 +483,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);
@ -478,7 +553,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,