remove dupecheck
This commit is contained in:
parent
ed179010a7
commit
4b1039f06a
2 changed files with 5 additions and 13 deletions
|
|
@ -966,7 +966,7 @@ export default {
|
|||
const gaScheduleType = {
|
||||
['service_type']: this.selectedAppointmentType.toLowerCase()
|
||||
};
|
||||
this.pushGenericObjectToGA(gaScheduleType, 'service_type', true);
|
||||
this.pushGenericObjectToGA(gaScheduleType);
|
||||
}
|
||||
},
|
||||
async refreshDatePicker() {
|
||||
|
|
|
|||
|
|
@ -27,10 +27,6 @@ import coverageType from '@/constants/coverage-type';
|
|||
import issPageValues from '@/router/router-constants/issPage-values';
|
||||
import { useMainStore } from '@/store';
|
||||
|
||||
function keyExistsInDataLayer(keyName) {
|
||||
return window.dataLayer.some(obj => Object.prototype.hasOwnProperty.call(obj, keyName));
|
||||
}
|
||||
|
||||
function pushToDataLayerIfDefined(data) {
|
||||
if (window.dataLayer !== undefined) {
|
||||
window.dataLayer.push(data);
|
||||
|
|
@ -114,12 +110,8 @@ export default {
|
|||
this.logCustomEvent(category, action, labelToLog, value);
|
||||
}
|
||||
},
|
||||
pushGenericObjectToGA(object, keyName = null, skipExistsCheck = false) {
|
||||
if (keyName && keyExistsInDataLayer(keyName) && !skipExistsCheck) {
|
||||
console.log(`Key ${keyName} already exists in dataLayer. Skipping push.`);
|
||||
} else {
|
||||
pushToDataLayerIfDefined(object);
|
||||
}
|
||||
pushGenericObjectToGA(object) {
|
||||
pushToDataLayerIfDefined(object);
|
||||
},
|
||||
|
||||
pushPageViewToGA() {
|
||||
|
|
@ -139,13 +131,13 @@ export default {
|
|||
const gaSiteType = {
|
||||
['siteType']: useMainStore().issConfig.siteType
|
||||
};
|
||||
this.pushGenericObjectToGA(gaSiteType, 'siteType');
|
||||
this.pushGenericObjectToGA(gaSiteType);
|
||||
|
||||
const gaServiceType = {
|
||||
['service_type']: useMainStore().order?.serviceLocation?.appointmentType?.toLowerCase()
|
||||
};
|
||||
if (gaServiceType && gaServiceType['service_type']) {
|
||||
this.pushGenericObjectToGA(gaServiceType, 'service_type');
|
||||
this.pushGenericObjectToGA(gaServiceType);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue