Some refinement.
This commit is contained in:
parent
c4bd1de992
commit
98f0197b47
3 changed files with 21 additions and 15 deletions
|
|
@ -15,7 +15,6 @@ const GaEvents = Object.freeze({
|
||||||
const GaCategories = Object.freeze({
|
const GaCategories = Object.freeze({
|
||||||
API_RESPONSE: 'Api_Response',
|
API_RESPONSE: 'Api_Response',
|
||||||
BAILOUT: 'Bailout',
|
BAILOUT: 'Bailout',
|
||||||
BAILOUT_DETAILS: 'Bailout-Details',
|
|
||||||
CONFIRMATION_CLICKED: "confirmation clicked",
|
CONFIRMATION_CLICKED: "confirmation clicked",
|
||||||
CONFIRMATION_CLICKED_INSHOP: "inshop confirmation clicked",
|
CONFIRMATION_CLICKED_INSHOP: "inshop confirmation clicked",
|
||||||
CONFIRMATION_CLICKED_MOBILE: "mobile confirmation clicked",
|
CONFIRMATION_CLICKED_MOBILE: "mobile confirmation clicked",
|
||||||
|
|
|
||||||
|
|
@ -49,17 +49,19 @@ export class Logger {
|
||||||
json = `Failed to serialize log details: ${error}`;
|
json = `Failed to serialize log details: ${error}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return `Application: ${applicationConfig.APPLICATION_NAME}
|
return [
|
||||||
ClientTag: ${store.issConfig?.clientTag}
|
`Application: ${applicationConfig.APPLICATION_NAME}`,
|
||||||
ParentAccountNumber: ${store.issConfig?.parentAccountNumber}
|
`ClientTag: ${store.issConfig?.clientTag}`,
|
||||||
ClientName: ${store.issConfig?.clientName}
|
`ParentAccountNumber: ${store.issConfig?.parentAccountNumber}`,
|
||||||
LastPageVisited: ${store.applicationUser?.lastPageVisited}
|
`ClientName: ${store.issConfig?.clientName}`,
|
||||||
SessionLogSequenceNumber: ${sessionKey}
|
`LastPageVisited: ${store.applicationUser?.lastPageVisited}`,
|
||||||
ReferralSequenceNumber: ${store.order?.referralSequenceNumber}
|
`SessionLogSequenceNumber: ${sessionKey}`,
|
||||||
ReferralNumber: ${store.order?.referralNumber}
|
`ReferralSequenceNumber: ${store.order?.referralSequenceNumber}`,
|
||||||
EON: ${store.order?.eon}
|
`ReferralNumber: ${store.order?.referralNumber}`,
|
||||||
Message: ${message}
|
`EON: ${store.order?.eon}`,
|
||||||
JSON: ${json}`;
|
`Message: ${message}`,
|
||||||
|
`JSON: ${json}`
|
||||||
|
].join('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
writeLogEntry(endpoint, logEntry) {
|
writeLogEntry(endpoint, logEntry) {
|
||||||
|
|
|
||||||
|
|
@ -116,13 +116,18 @@ export default {
|
||||||
mixins: [BaseFormMixin, analyticsMixIn],
|
mixins: [BaseFormMixin, analyticsMixIn],
|
||||||
async beforeRouteEnter(to, from, next) {
|
async beforeRouteEnter(to, from, next) {
|
||||||
const fromPage = from?.query?.issPage || 'external';
|
const fromPage = from?.query?.issPage || 'external';
|
||||||
|
|
||||||
// Only log bailout event if user is coming from a different page.
|
// Only log bailout event if user is coming from a different page.
|
||||||
// This ensures that we cannot get stuck in a loop, if the bailout-page ever bails out.
|
// This ensures that we cannot get stuck in a loop, if the bailout-page ever bails out.
|
||||||
if (fromPage !== issPageValues.BAILOUT_PAGE) {
|
if (fromPage !== issPageValues.BAILOUT_PAGE) {
|
||||||
const bailoutCode = useMainStore().pageData(issPageValues.BAILOUT_PAGE).bailoutCode;
|
const bailoutPageData = useMainStore().pageData(issPageValues.BAILOUT_PAGE);
|
||||||
const bailoutErrorMessage = useMainStore().pageData(issPageValues.BAILOUT_PAGE).errorMessage;
|
const bailoutCode = bailoutPageData.bailoutCode;
|
||||||
const bailoutString = Object.keys(BailoutCode).find(key => BailoutCode[key] === bailoutCode);
|
const bailoutString = Object.keys(BailoutCode).find(key => BailoutCode[key] === bailoutCode);
|
||||||
analyticsMixIn.methods.pushEventToGA(GaCategories.BAILOUT_DETAILS, bailoutString, "Page: " + fromPage + " - Error Message: " + bailoutErrorMessage, true, null, null);
|
|
||||||
|
// Log Bailout info to the error log for quick searching.
|
||||||
|
global.$logger.logError(`Bailout - Page: ${fromPage} - BailoutCode: ${bailoutCode} - BailoutString: ${bailoutString}`, bailoutPageData);
|
||||||
|
|
||||||
|
// Log a couple main bailout items to GA and session log events.
|
||||||
analyticsMixIn.methods.pushEventToGA(GaCategories.BAILOUT, bailoutString, fromPage, true, null, null);
|
analyticsMixIn.methods.pushEventToGA(GaCategories.BAILOUT, bailoutString, fromPage, true, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue