Merge pull request #1149 from Safelite/feature/humphries/INSR-8878

INSR-8878/9031: Add analytics events on welcome-page and contact-details
This commit is contained in:
AHumphriesSL 2026-03-25 16:04:50 -04:00 committed by GitHub
commit 1714c232f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 55 additions and 2 deletions

View file

@ -68,6 +68,7 @@ export default {
},
methods: {
openModal() {
this.pushEventToGA("existing_claim", "pop_up_displayed", this.mainStore.accountNameForEvents, true);
this.$refs.continueModal.openModal();
},
setModalStatus(isOpened) {
@ -77,9 +78,11 @@ export default {
this.$refs.continueModal.closeModal();
},
continueReferral() {
this.pushEventToGA("existing_claim", "finish_claim", this.mainStore.accountNameForEvents, true);
this.$emit('continue-previous-referral');
},
startNewReferral() {
this.pushEventToGA("existing_claim", "start_new_claim", this.mainStore.accountNameForEvents, true);
this.$emit('start-new-referral');
}
}

View file

@ -230,11 +230,15 @@ export default {
},
watch: {
isSameAsPolicyAddress(newValue) {
this.pushEventToGA("mobile_location", "same_as_policy_address", newValue ? "checked" : "unchecked", true);
if (newValue) {
this.copyPolicyAddressToServiceLocation();
} else {
this.clearAddressFields();
}
},
isVehicleProtected(newValue) {
this.pushEventToGA("mobile_location", "is_vehicle_protected", newValue, true);
}
},
methods: {

View file

@ -68,6 +68,7 @@
:options="DamageCauseOptions"
disableAutoFill
:validationRules="rules.damageOption"
isRequired
placeHolderText="Select an option"
class="form-group" />
<textboxQuestion
@ -252,6 +253,35 @@ export default {
}
};
},
mounted() {
if (this.mainStore.applicationUser.firstHit) {
const isInfoPrefilled = !!(this.mainStore.order.policy.policyNumber
&& this.mainStore.order.policy.dateOfLoss
&& this.mainStore.order.policy.policyZipCode);
this.pushEventToGA("policy_info", "info_prefilled", isInfoPrefilled.toString(), true);
this.$nextTick(() => {
const formRoot = this.$el;
const requiredFieldCount = formRoot.querySelectorAll('[aria-required="true"]').length;
this.pushEventToGA("policy_info", "required_fields", requiredFieldCount.toString(), true);
});
this.mainStore.applicationUser.firstHit = false;
}
// TODO: Check if we're coming from SFA
// eslint-disable-next-line
if (false) {
this.pushEventToGA("co_branded", "welcome_clicked_cta", "yes_clicked", 0);
this.pushEventToGA("visitor_info_welcome", "referring_site", "SFA", null);
}
else {
this.pushEventToGA("visitor_info_welcome", "referring_site", "ClientSite", null);
}
this.pushEventToGA("visitor_info_welcome", "client_name", this.mainStore.accountNameForEvents, null);
},
computed: {
DamageCauseOptions() {
const damageCauseAnswers = this.getCmsContent(
@ -460,6 +490,20 @@ export default {
this.answeredContinueModal = true;
this.$refs.continueModal.closeModal();
}
},
watch: {
'welcomePageModel.policyZipCode': {
handler: async function (newZip) {
if (newZip.length === 5) {
this.pushEventToGA("policy_info", "policy_zip", newZip, true);
}
}
},
'welcomePageModel.damageCause': function (newCause) {
if (newCause) {
this.pushEventToGA("policy_info", "cause_of_loss", newCause, true);
}
}
}
};
</script>

View file

@ -239,7 +239,8 @@ export const getDefaultState = () => ({
triggeredSiteEntry: false, // TODO not in save session
duplicateOrders: [],
hasSentSaveQuoteEmail: null,
coverageLookupAttempts: 0
coverageLookupAttempts: 0,
firstHit: true
},
issConfig: {
clientName: 'Generic Insurance', // this is the default and will be overriden by the client's name
@ -445,7 +446,8 @@ export const useMainStore = defineStore({
.map((x) => x.settings)
.reduce((r, c) => Object.assign(r, c), {}) ?? {},
originalDeductible: (state) => (state.order.damage.isRepair ? state.order.originalDeductible.repair : state.order.originalDeductible.replace),
currentDeductible: (state) => (state.order.damage.isRepair ? state.order.currentDeductible.repair : state.order.currentDeductible.replace)
currentDeductible: (state) => (state.order.damage.isRepair ? state.order.currentDeductible.repair : state.order.currentDeductible.replace),
accountNameForEvents: (state) => state.issConfig.clientName.replaceAll(" ", "").replaceAll("&", "amp")
},
actions:
{