Merge pull request #1195 from Safelite/feature/CSR-1439.1
CSR-1439 remove params from endpoint logging
This commit is contained in:
commit
45c407046b
2 changed files with 14 additions and 1 deletions
|
|
@ -39,9 +39,11 @@ export default {
|
|||
}
|
||||
const pageName = analyticsMixIn.methods.getPageName();
|
||||
const nextPageName = router.lastNavigationPage || pageName;
|
||||
const endpointWithoutParams =
|
||||
analyticsMixIn.methods.removeParamsFromEndpoint(endpoint);
|
||||
analyticsMixIn.methods.pushEventToGA(
|
||||
GaCategories.API_RESPONSE,
|
||||
`${nextPageName}_${endpoint}`,
|
||||
`${nextPageName}_${endpointWithoutParams}`,
|
||||
`${GaLabels.SUCCESS}${additionalEventData}`,
|
||||
true
|
||||
);
|
||||
|
|
|
|||
|
|
@ -176,6 +176,17 @@ export default {
|
|||
getSessionIdValue() === "00000000-0000-0000-0000-000000000000"
|
||||
);
|
||||
},
|
||||
|
||||
removeParamsFromEndpoint(endpoint) {
|
||||
const numSlashesBeforeParams = 6;
|
||||
let splitString = endpoint.split("/");
|
||||
if (splitString.length > numSlashesBeforeParams) {
|
||||
splitString = splitString.slice(0, numSlashesBeforeParams);
|
||||
return splitString.join("/");
|
||||
} else {
|
||||
return endpoint;
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
analyticsPageEvents() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue