CSR-1436 provisional triggers ga event logging
This commit is contained in:
parent
ad2df4e765
commit
e89eadcb46
3 changed files with 23 additions and 1 deletions
|
|
@ -39,9 +39,11 @@ export default {
|
||||||
}
|
}
|
||||||
const pageName = analyticsMixIn.methods.getPageName();
|
const pageName = analyticsMixIn.methods.getPageName();
|
||||||
const nextPageName = router.lastNavigationPage || pageName;
|
const nextPageName = router.lastNavigationPage || pageName;
|
||||||
|
const endpointWithoutParams =
|
||||||
|
analyticsMixIn.methods.removeParamsFromEndpoint(endpoint);
|
||||||
analyticsMixIn.methods.pushEventToGA(
|
analyticsMixIn.methods.pushEventToGA(
|
||||||
GaCategories.API_RESPONSE,
|
GaCategories.API_RESPONSE,
|
||||||
`${nextPageName}_${endpoint}`,
|
`${nextPageName}_${endpointWithoutParams}`,
|
||||||
`${GaLabels.SUCCESS}${additionalEventData}`,
|
`${GaLabels.SUCCESS}${additionalEventData}`,
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -176,6 +176,18 @@ export default {
|
||||||
getSessionIdValue() === "00000000-0000-0000-0000-000000000000"
|
getSessionIdValue() === "00000000-0000-0000-0000-000000000000"
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
removeParamsFromEndpoint(endpoint) {
|
||||||
|
const endpointWithoutParams = endpoint.split("?")[0];
|
||||||
|
const numSlashesBeforeParams = 6;
|
||||||
|
let splitString = endpointWithoutParams.split("/");
|
||||||
|
if (splitString.length > numSlashesBeforeParams) {
|
||||||
|
splitString = splitString.slice(0, numSlashesBeforeParams);
|
||||||
|
return splitString.join("/");
|
||||||
|
} else {
|
||||||
|
return endpointWithoutParams;
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
analyticsPageEvents() {
|
analyticsPageEvents() {
|
||||||
|
|
|
||||||
|
|
@ -596,6 +596,10 @@ function getNonFalseValuesOfPropertyInArrayOfObjects(array, propertyName) {
|
||||||
return (array ?? []).map((x) => x[propertyName]).filter((x) => x);
|
return (array ?? []).map((x) => x[propertyName]).filter((x) => x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function provisionalTriggersToString(provisionalTriggers) {
|
||||||
|
return "ProvisionalTriggers:" + provisionalTriggers.join(",");
|
||||||
|
}
|
||||||
|
|
||||||
// Export Actions
|
// Export Actions
|
||||||
export const actions = {
|
export const actions = {
|
||||||
// Vehicle API Actions
|
// Vehicle API Actions
|
||||||
|
|
@ -1267,6 +1271,8 @@ export const actions = {
|
||||||
method: endpoints.GetShopTimeSlots.method,
|
method: endpoints.GetShopTimeSlots.method,
|
||||||
endpoint: endpoints.GetShopTimeSlots.url,
|
endpoint: endpoints.GetShopTimeSlots.url,
|
||||||
payload: payload,
|
payload: payload,
|
||||||
|
additionalSuccessEventDataHandler: (response) =>
|
||||||
|
provisionalTriggersToString(response.data.provisionalTriggers),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -1318,6 +1324,8 @@ export const actions = {
|
||||||
method: endpoints.GetMobileTimeSlots.method,
|
method: endpoints.GetMobileTimeSlots.method,
|
||||||
endpoint: endpoints.GetMobileTimeSlots.url,
|
endpoint: endpoints.GetMobileTimeSlots.url,
|
||||||
payload: payload,
|
payload: payload,
|
||||||
|
additionalSuccessEventDataHandler: (response) =>
|
||||||
|
provisionalTriggersToString(response.data.provisionalTriggers),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue