matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.9k stars 2.65k forks source link

Support Error report with in Angular framework #19562

Closed VincentCoucharriere closed 5 months ago

VincentCoucharriere commented 2 years ago

I seems that Angular framework caches and handles "uncaught" JS error / exception : new Error('my error') This prevents Matomo from catching & reporting these errors. How to solve this ? Can you please take care of this ?

Summary

Your Environment

bx80 commented 2 years ago

Hi @VincentCoucharriere, thanks for your question. We're in the process of migrating Matomo from AngularJS to Vue.js which should resolve this issue.

Could you explain a bit about what you are trying to achieve by catching JavaScript errors? If you are experiencing a JavaScript error with Matomo cloud then I'd recommend contacting support. If you are developing a plugin or making code changes then it's possible to define an AngularJS exception handler to catch and log errors.

heurteph-ei commented 2 years ago

@bx80 @VincentCoucharriere, wouldn't it be about this option (in MTM): image ?

(then this topic should be moved into the MTM project)

sgiehl commented 2 years ago

@heurteph-ei Guess it is a bit unclear what the issue actually was about. If it is about catching and tracking javascript errors on a website, then it might be correct here. Matomo currently appends an onError handler to track possible javascript errors. If Angular or other frameworks might catch there errors themself and the error handler is not triggered, then Matomo currently can't track it. But if Angular provides a possibility to hook into their error handling, one could even track the javascript error event manually.

sgiehl commented 5 months ago

Closing this one as there hadn't been any further activity. We've meanwhile also released a new premium plugin for analyzing javascript errors, which might help in this manner: https://plugins.matomo.org/CrashAnalytics