DanielCaspers / CA-Portal

1 stars 0 forks source link

Analytics - Click event for Service needed #41

Closed scaspers closed 4 years ago

scaspers commented 4 years ago

Wondering if we can track the click of "Service needed" from the My Vehicles page?

DanielCaspers commented 4 years ago

Yes, we most certainly can. I decided to also lump in the following analytics 1) Scheduled appointment 2) Vehicle-Card - More items "..." menu clicked 3) HTTP request failure diagnostics and crash reporting via HTTP interceptor.

I haven't looked at the exact Google Analytics account, so you'll have to let me know how the latest failed requests look. I want it to track any HTTP 4xx or 5xx so you have an automated way to know if bugs or issues are encountered. It should include an error string hopefully of the response. Here's the relevant code snippet.

const crashReport = {
    httpStatus: err.status,
    requestUrl: err.url,
    message: err.message
};
this.googleAnalyticsService.eventTrack('Request failed', {
    category: 'App Diagnostics',
    label: 'HTTP Request Interceptor',
    value: JSON.stringify(crashReport)
});
DanielCaspers commented 4 years ago

@scaspers assigning to you to verify the following analytics and close. You should hopefully see my existing HTTP 500 crash reports tomorrow if realtime tracking wasn't working.

DanielCaspers commented 4 years ago

Discussed over phone with Steve. The information is provided at sufficient depth for now. No work was performed to confirm whether or not the "value" field is extractable from Google Analytics.