Merge pull request #1243 from Safelite/feature/humphries/INSR-8489.1
INSR-8489: Add GA events for advanced mobile modal
This commit is contained in:
commit
d7d58e71e5
2 changed files with 18 additions and 2 deletions
|
|
@ -37,7 +37,7 @@ export default {
|
|||
components: {
|
||||
modal
|
||||
},
|
||||
emits: ['change-appointment-clicked'],
|
||||
emits: ['change-appointment-clicked', 'advanced-mobile-modal-opened'],
|
||||
props: {
|
||||
cmsWidgetName: {
|
||||
type: String,
|
||||
|
|
@ -64,6 +64,7 @@ export default {
|
|||
methods: {
|
||||
openModal() {
|
||||
this.$refs.advancedMobileModal.openModal();
|
||||
this.$emit('advanced-mobile-modal-opened');
|
||||
},
|
||||
footerButtonClick() {
|
||||
this.$refs.advancedMobileModal.closeModal();
|
||||
|
|
|
|||
|
|
@ -119,7 +119,8 @@
|
|||
<advancedMobileModal
|
||||
:ref="ADVANCED_MOBILE_MODAL_REF_NAME"
|
||||
:cmsWidgetName="widget.advancedMobileModal"
|
||||
@changeAppointmentClicked="switchToInShop" />
|
||||
@changeAppointmentClicked="switchToInShop"
|
||||
@advancedMobileModalOpened="handleAdvancedMobileModalOpened" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
|
@ -186,6 +187,17 @@ export default {
|
|||
ADVANCED_MOBILE_MODAL_REF_NAME
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
if (!this.readOnly) {
|
||||
const hasMobileFee = this.cartItems?.some((item) => item.partType === partTypeStrings.MOBILE_FEE);
|
||||
if (hasMobileFee) {
|
||||
this.pushEventToGA('advanced_mobile_modal', 'yes', this.cartOrder.vehicle.carId, true);
|
||||
}
|
||||
else {
|
||||
this.pushEventToGA('advanced_mobile_modal', 'no', this.cartOrder.vehicle.carId, true);
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
cartOrder() {
|
||||
return this.submittedOrder ?? useMainStore().order;
|
||||
|
|
@ -438,6 +450,9 @@ export default {
|
|||
switchToInShop() {
|
||||
this.$emit('switch-to-in-shop');
|
||||
},
|
||||
handleAdvancedMobileModalOpened() {
|
||||
this.pushEventToGA('advanced_mobile_modal', 'remove_clicked', this.cartOrder.vehicle.carId, true);
|
||||
},
|
||||
formatAmountInDollars
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue