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({
|
||||
API_RESPONSE: 'Api_Response',
|
||||
BAILOUT: 'Bailout',
|
||||
BAILOUT_DETAILS: 'Bailout-Details',
|
||||
CONFIRMATION_CLICKED: "confirmation clicked",
|
||||
CONFIRMATION_CLICKED_INSHOP: "inshop confirmation clicked",
|
||||
CONFIRMATION_CLICKED_MOBILE: "mobile confirmation clicked",
|
||||
|
|
|
|||
|
|
@ -49,17 +49,19 @@ export class Logger {
|
|||
json = `Failed to serialize log details: ${error}`;
|
||||
}
|
||||
|
||||
return `Application: ${applicationConfig.APPLICATION_NAME}
|
||||
ClientTag: ${store.issConfig?.clientTag}
|
||||
ParentAccountNumber: ${store.issConfig?.parentAccountNumber}
|
||||
ClientName: ${store.issConfig?.clientName}
|
||||
LastPageVisited: ${store.applicationUser?.lastPageVisited}
|
||||
SessionLogSequenceNumber: ${sessionKey}
|
||||
ReferralSequenceNumber: ${store.order?.referralSequenceNumber}
|
||||
ReferralNumber: ${store.order?.referralNumber}
|
||||
EON: ${store.order?.eon}
|
||||
Message: ${message}
|
||||
JSON: ${json}`;
|
||||
return [
|
||||
`Application: ${applicationConfig.APPLICATION_NAME}`,
|
||||
`ClientTag: ${store.issConfig?.clientTag}`,
|
||||
`ParentAccountNumber: ${store.issConfig?.parentAccountNumber}`,
|
||||
`ClientName: ${store.issConfig?.clientName}`,
|
||||
`LastPageVisited: ${store.applicationUser?.lastPageVisited}`,
|
||||
`SessionLogSequenceNumber: ${sessionKey}`,
|
||||
`ReferralSequenceNumber: ${store.order?.referralSequenceNumber}`,
|
||||
`ReferralNumber: ${store.order?.referralNumber}`,
|
||||
`EON: ${store.order?.eon}`,
|
||||
`Message: ${message}`,
|
||||
`JSON: ${json}`
|
||||
].join('\n');
|
||||
}
|
||||
|
||||
writeLogEntry(endpoint, logEntry) {
|
||||
|
|
|
|||
|
|
@ -116,13 +116,18 @@ export default {
|
|||
mixins: [BaseFormMixin, analyticsMixIn],
|
||||
async beforeRouteEnter(to, from, next) {
|
||||
const fromPage = from?.query?.issPage || 'external';
|
||||
|
||||
// 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.
|
||||
if (fromPage !== issPageValues.BAILOUT_PAGE) {
|
||||
const bailoutCode = useMainStore().pageData(issPageValues.BAILOUT_PAGE).bailoutCode;
|
||||
const bailoutErrorMessage = useMainStore().pageData(issPageValues.BAILOUT_PAGE).errorMessage;
|
||||
const bailoutPageData = useMainStore().pageData(issPageValues.BAILOUT_PAGE);
|
||||
const bailoutCode = bailoutPageData.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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue