INSR-8878/9031: Add analytics events on welcome-page and contact-details
This commit is contained in:
parent
de9a856f9b
commit
7f565fb8cf
4 changed files with 58 additions and 1 deletions
|
|
@ -64,10 +64,14 @@ export default {
|
||||||
modalSubHeaderText() {
|
modalSubHeaderText() {
|
||||||
return this.getCmsContent('ContinueReferralModalWidget', 'SubheaderText')
|
return this.getCmsContent('ContinueReferralModalWidget', 'SubheaderText')
|
||||||
.replaceAll('{custom:mmFound}', this.getMakeModelString.toUpperCase());
|
.replaceAll('{custom:mmFound}', this.getMakeModelString.toUpperCase());
|
||||||
|
},
|
||||||
|
accountName() {
|
||||||
|
return this.mainStore.issConfig.clientName.replaceAll(" ", "").replaceAll("&", "amp");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
openModal() {
|
openModal() {
|
||||||
|
this.pushEventToGA("existing_claim", "pop_up_displayed", this.accountName, true);
|
||||||
this.$refs.continueModal.openModal();
|
this.$refs.continueModal.openModal();
|
||||||
},
|
},
|
||||||
setModalStatus(isOpened) {
|
setModalStatus(isOpened) {
|
||||||
|
|
@ -77,9 +81,11 @@ export default {
|
||||||
this.$refs.continueModal.closeModal();
|
this.$refs.continueModal.closeModal();
|
||||||
},
|
},
|
||||||
continueReferral() {
|
continueReferral() {
|
||||||
|
this.pushEventToGA("existing_claim", "finish_claim", this.accountName, true);
|
||||||
this.$emit('continue-previous-referral');
|
this.$emit('continue-previous-referral');
|
||||||
},
|
},
|
||||||
startNewReferral() {
|
startNewReferral() {
|
||||||
|
this.pushEventToGA("existing_claim", "start_new_claim", this.accountName, true);
|
||||||
this.$emit('start-new-referral');
|
this.$emit('start-new-referral');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -230,11 +230,15 @@ export default {
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
isSameAsPolicyAddress(newValue) {
|
isSameAsPolicyAddress(newValue) {
|
||||||
|
this.pushEventToGA("mobile_location", "same_as_policy_address", newValue ? "checked" : "unchecked", true);
|
||||||
if (newValue) {
|
if (newValue) {
|
||||||
this.copyPolicyAddressToServiceLocation();
|
this.copyPolicyAddressToServiceLocation();
|
||||||
} else {
|
} else {
|
||||||
this.clearAddressFields();
|
this.clearAddressFields();
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
isVehicleProtected(newValue) {
|
||||||
|
this.pushEventToGA("mobile_location", "is_vehicle_protected", newValue, true);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@
|
||||||
:options="DamageCauseOptions"
|
:options="DamageCauseOptions"
|
||||||
disableAutoFill
|
disableAutoFill
|
||||||
:validationRules="rules.damageOption"
|
:validationRules="rules.damageOption"
|
||||||
|
isRequired
|
||||||
placeHolderText="Select an option"
|
placeHolderText="Select an option"
|
||||||
class="form-group" />
|
class="form-group" />
|
||||||
<textboxQuestion
|
<textboxQuestion
|
||||||
|
|
@ -252,6 +253,34 @@ 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 requiredFieldCount = document.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.accountName, null);
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
DamageCauseOptions() {
|
DamageCauseOptions() {
|
||||||
const damageCauseAnswers = this.getCmsContent(
|
const damageCauseAnswers = this.getCmsContent(
|
||||||
|
|
@ -300,6 +329,9 @@ export default {
|
||||||
},
|
},
|
||||||
phoneMask() {
|
phoneMask() {
|
||||||
return MaskaFormattedMasks.PHONE_NUMBER;
|
return MaskaFormattedMasks.PHONE_NUMBER;
|
||||||
|
},
|
||||||
|
accountName() {
|
||||||
|
return this.mainStore.issConfig.clientName.replaceAll(" ", "").replaceAll("&", "amp");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -460,6 +492,20 @@ export default {
|
||||||
this.answeredContinueModal = true;
|
this.answeredContinueModal = true;
|
||||||
this.$refs.continueModal.closeModal();
|
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>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -238,7 +238,8 @@ export const getDefaultState = () => ({
|
||||||
triggeredSiteEntry: false, // TODO not in save session
|
triggeredSiteEntry: false, // TODO not in save session
|
||||||
duplicateOrders: [],
|
duplicateOrders: [],
|
||||||
hasSentSaveQuoteEmail: null,
|
hasSentSaveQuoteEmail: null,
|
||||||
coverageLookupAttempts: 0
|
coverageLookupAttempts: 0,
|
||||||
|
firstHit: true
|
||||||
},
|
},
|
||||||
issConfig: {
|
issConfig: {
|
||||||
clientName: 'Generic Insurance', // this is the default and will be overriden by the client's name
|
clientName: 'Generic Insurance', // this is the default and will be overriden by the client's name
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue