Taking Countly as an example this time
Initialisation Factory function
Plugging it in its own module
Tracking declared and realtime events
Tracking page view events injecting this Factory function
For events(operations) which relies on some API response arrival
For pushing error logs to Countly
export class CountlyErrorHandler implements ErrorHandler {
handleError(error: unknown) {
Countly.q.push(['log_error', error]);
console.error(error);
}
}