INSR-8881: Add events to coverage-statement
This commit is contained in:
parent
66ba4498fe
commit
5dcb2dc63d
6 changed files with 106 additions and 13 deletions
|
|
@ -30,6 +30,7 @@ export default {
|
||||||
default: 'RecalModal'
|
default: 'RecalModal'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
emits: ['recal-modal-opened'],
|
||||||
computed: {
|
computed: {
|
||||||
modalBodyText() {
|
modalBodyText() {
|
||||||
return this.getCmsContent(this.cmsWidgetName, 'BodyText').replaceAll('{custom:vehicleMake}', this.vehicleMake);
|
return this.getCmsContent(this.cmsWidgetName, 'BodyText').replaceAll('{custom:vehicleMake}', this.vehicleMake);
|
||||||
|
|
@ -50,6 +51,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
openModal() {
|
openModal() {
|
||||||
this.$refs.recalModal.openModal();
|
this.$refs.recalModal.openModal();
|
||||||
|
this.$emit('recal-modal-opened');
|
||||||
},
|
},
|
||||||
footerButtonClick() {
|
footerButtonClick() {
|
||||||
this.$refs.recalModal.closeModal();
|
this.$refs.recalModal.closeModal();
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,8 @@ describe('coverageStatement.vue', () => {
|
||||||
const mainInitialState = {
|
const mainInitialState = {
|
||||||
order: {
|
order: {
|
||||||
damage: {
|
damage: {
|
||||||
isRepair: true
|
isRepair: true,
|
||||||
|
numberOfChips: 2
|
||||||
},
|
},
|
||||||
insuranceCoverage: {
|
insuranceCoverage: {
|
||||||
coverageStatus: coverageStatuses.PENDING,
|
coverageStatus: coverageStatuses.PENDING,
|
||||||
|
|
@ -606,7 +607,8 @@ describe('coverageStatement.vue', () => {
|
||||||
const mainInitialState = {
|
const mainInitialState = {
|
||||||
order: {
|
order: {
|
||||||
damage: {
|
damage: {
|
||||||
isRepair: true
|
isRepair: true,
|
||||||
|
numberOfChips: 2
|
||||||
},
|
},
|
||||||
insuranceCoverage: {
|
insuranceCoverage: {
|
||||||
coverageStatus: coverageStatuses.PENDING,
|
coverageStatus: coverageStatuses.PENDING,
|
||||||
|
|
@ -636,7 +638,8 @@ describe('coverageStatement.vue', () => {
|
||||||
const mainInitialState = {
|
const mainInitialState = {
|
||||||
order: {
|
order: {
|
||||||
damage: {
|
damage: {
|
||||||
isRepair: true
|
isRepair: true,
|
||||||
|
numberOfChips: 2
|
||||||
},
|
},
|
||||||
insuranceCoverage: {
|
insuranceCoverage: {
|
||||||
coverageStatus: coverageStatuses.VERIFIED,
|
coverageStatus: coverageStatuses.VERIFIED,
|
||||||
|
|
@ -665,7 +668,8 @@ describe('coverageStatement.vue', () => {
|
||||||
const mainInitialState = {
|
const mainInitialState = {
|
||||||
order: {
|
order: {
|
||||||
damage: {
|
damage: {
|
||||||
isRepair: true
|
isRepair: true,
|
||||||
|
numberOfChips: 2
|
||||||
},
|
},
|
||||||
insuranceCoverage: {
|
insuranceCoverage: {
|
||||||
coverageStatus: coverageStatuses.VERIFIED,
|
coverageStatus: coverageStatuses.VERIFIED,
|
||||||
|
|
@ -697,7 +701,8 @@ describe('coverageStatement.vue', () => {
|
||||||
const mainInitialState = {
|
const mainInitialState = {
|
||||||
order: {
|
order: {
|
||||||
damage: {
|
damage: {
|
||||||
isRepair: true
|
isRepair: true,
|
||||||
|
numberOfChips: 2
|
||||||
},
|
},
|
||||||
insuranceCoverage: {
|
insuranceCoverage: {
|
||||||
coverageStatus: coverageStatuses.VERIFIED,
|
coverageStatus: coverageStatuses.VERIFIED,
|
||||||
|
|
@ -724,7 +729,8 @@ describe('coverageStatement.vue', () => {
|
||||||
const mainInitialState = {
|
const mainInitialState = {
|
||||||
order: {
|
order: {
|
||||||
damage: {
|
damage: {
|
||||||
isRepair: true
|
isRepair: true,
|
||||||
|
numberOfChips: 2
|
||||||
},
|
},
|
||||||
insuranceCoverage: {
|
insuranceCoverage: {
|
||||||
coverageStatus: coverageStatuses.VERIFIED,
|
coverageStatus: coverageStatuses.VERIFIED,
|
||||||
|
|
@ -755,7 +761,8 @@ describe('coverageStatement.vue', () => {
|
||||||
const mainInitialState = {
|
const mainInitialState = {
|
||||||
order: {
|
order: {
|
||||||
damage: {
|
damage: {
|
||||||
isRepair: true
|
isRepair: true,
|
||||||
|
numberOfChips: 2
|
||||||
},
|
},
|
||||||
insuranceCoverage: {
|
insuranceCoverage: {
|
||||||
coverageStatus: coverageStatuses.VERIFIED,
|
coverageStatus: coverageStatuses.VERIFIED,
|
||||||
|
|
|
||||||
|
|
@ -103,14 +103,16 @@
|
||||||
</div>
|
</div>
|
||||||
<recalModal
|
<recalModal
|
||||||
:ref="RECAL_MODAL_REF_NAME"
|
:ref="RECAL_MODAL_REF_NAME"
|
||||||
cmsWidgetName="RecalModal" />
|
cmsWidgetName="RecalModal"
|
||||||
|
@recalModalOpened="handleRecalModalOpened" />
|
||||||
<cancelClaimModal
|
<cancelClaimModal
|
||||||
:ref="CANCEL_CLAIM_REF_NAME"
|
:ref="CANCEL_CLAIM_REF_NAME"
|
||||||
@cancelClaimConfirmation="cancelClaim"
|
@cancelClaimConfirmation="cancelClaim"
|
||||||
@returnToClaim="navigateForward" />
|
@returnToClaim="navigateForward" />
|
||||||
<oemEndorsementModal
|
<oemEndorsementModal
|
||||||
:ref="OEM_ENDORSEMENT_REF_NAME"
|
:ref="OEM_ENDORSEMENT_REF_NAME"
|
||||||
cmsWidgetName="OEMEndorsementModal" />
|
cmsWidgetName="OEMEndorsementModal"
|
||||||
|
@oemEndorsementModalOpened="handleOemEndorsementModalOpened" />
|
||||||
</Form>
|
</Form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -374,6 +376,71 @@ export default {
|
||||||
setupModalLinks(this);
|
setupModalLinks(this);
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
arePagePrerequisitesValid() {
|
||||||
return !!useMainStore().vehicle.carId;
|
return !!useMainStore().vehicle.carId;
|
||||||
},
|
},
|
||||||
|
|
@ -393,6 +460,8 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.logEventsToGA();
|
||||||
|
|
||||||
showIssLoadingModal(false);
|
showIssLoadingModal(false);
|
||||||
this.isPageLoading = false;
|
this.isPageLoading = false;
|
||||||
},
|
},
|
||||||
|
|
@ -410,8 +479,13 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async navigateForward() {
|
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);
|
this.navigateWithScenario(navigationScenarios.CLICKED_FORWARD);
|
||||||
} else if (this.isITACQuoteVisible || this.isNoCompQuoteVisible) {
|
} else if (this.isITACQuoteVisible || this.isNoCompQuoteVisible) {
|
||||||
this.mainStore.updateIsSafeliteProvider(true);
|
this.mainStore.updateIsSafeliteProvider(true);
|
||||||
|
|
@ -475,7 +549,13 @@ export default {
|
||||||
cancelClaim() {
|
cancelClaim() {
|
||||||
this.mainStore.updateIsSafeliteProvider(false);
|
this.mainStore.updateIsSafeliteProvider(false);
|
||||||
this.$router.navigateBailout(bailoutMessage.CoverageCancelledByUser());
|
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>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ export default {
|
||||||
default: 'OEMEndorsementModal'
|
default: 'OEMEndorsementModal'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
emits: ['oem-endorsement-modal-opened'],
|
||||||
computed: {
|
computed: {
|
||||||
modalBodyText() {
|
modalBodyText() {
|
||||||
return this.getCmsContent(this.cmsWidgetName, 'BodyText');
|
return this.getCmsContent(this.cmsWidgetName, 'BodyText');
|
||||||
|
|
@ -40,6 +41,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
openModal() {
|
openModal() {
|
||||||
this.$refs.oemEndorsementModal.openModal();
|
this.$refs.oemEndorsementModal.openModal();
|
||||||
|
this.$emit('oem-endorsement-modal-opened');
|
||||||
},
|
},
|
||||||
footerButtonClick() {
|
footerButtonClick() {
|
||||||
this.$refs.oemEndorsementModal.closeModal();
|
this.$refs.oemEndorsementModal.closeModal();
|
||||||
|
|
|
||||||
|
|
@ -193,7 +193,7 @@ export default {
|
||||||
appointmentType: serviceLocation.appointmentType,
|
appointmentType: serviceLocation.appointmentType,
|
||||||
providerAddress: serviceLocation?.provider?.address,
|
providerAddress: serviceLocation?.provider?.address,
|
||||||
customerPortalLoginToken,
|
customerPortalLoginToken,
|
||||||
carrierName: issConfig.clientName,
|
carrierName: issConfig.clientDisplayName,
|
||||||
carrierUrl: issConfig.successReturnURL,
|
carrierUrl: issConfig.successReturnURL,
|
||||||
isRepair: damage.isRepair,
|
isRepair: damage.isRepair,
|
||||||
hasRecalibrationPart,
|
hasRecalibrationPart,
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,8 @@ export default {
|
||||||
const currentPageName = this.getPageNameByQueryString();
|
const currentPageName = this.getPageNameByQueryString();
|
||||||
const labelToLog = getValueToLog(label, valueToLogType);
|
const labelToLog = getValueToLog(label, valueToLogType);
|
||||||
|
|
||||||
|
console.log(`Pushing event to GA: category=${category}, action=${action}, label=${labelToLog}, value=${value}, page=${currentPageName}`);
|
||||||
|
|
||||||
const eventToBePushed = {
|
const eventToBePushed = {
|
||||||
event: GaEvents.GENERIC_EVENT,
|
event: GaEvents.GENERIC_EVENT,
|
||||||
category,
|
category,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue