New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New: Automatic Javascript Error Tracking with Piwik! #4977
Comments
Replying to Thomas Steur:
makes sense, but may result in problems if users use tools to protect their privacy (like extension "ghostery" in FF ) which blocks piwik. If Piwik script is blocked sometimes the complete site is not usable any more because the following js is blocked/broken too.. |
Interesting, Google Analytics just released Javascript Exception Tracking as well! https://developers.google.com/analytics/devguides/collection/analyticsjs/exceptions |
See also #5257 Application Performance Management & Monitoring |
There are now many tools offering useful and usable JavaScript error tracking such as airbrake.io or raygun.io |
Is it a working feature or a planned one? |
It is working in general but only very basic. We simply track all errors as events for now but hope to provide similar enhanced features some day than others do |
"it is working in general but only very basic" |
Looks like there is no documentation for it indeed. There's a bit of documentation here: https://github.com/piwik/piwik/blob/2.16.0/js/piwik.js#L5869-L5886 and to activate it you can call It is very very basic though and I would suggest to first give it a try as it will add many different event actions and event names to your event reports in case you are using them for something else currently (it could give you a less good overview of action and names in event reports) |
thanks for your reply @RMastop |
this is full image |
@wei1215583760 When should the js error occur? Could you post the HTML of the page? |
this is my website code, index.html. And i add an error <script>a+b</scrip, and it can post HTML, but i can not track the error @RMastop ....sad t>, ths whole |
@RMastop |
@RMastop do you know where i the error message it stores as log data? |
@wei1215583760 I tried to reproduce the issue, but no call is triggered after the JS error. Without the call to the piwik server, no need to search for it in the database. |
thanks a lot for your patience, but i still do not know how to track the error, maybe this error can not be tracked? do you know what kind of error can be tracked? |
Now i want to make sure that this function can track errors and show it with piwik dashboard. if you have some examples, can you give me example errors?@RMastop |
Hi @wei1215583760, As documented, Could you put the Piwik tracking code all the way to the top op the HTML, just below
|
do you mean put the tracking code like this ? but it still have no reponse ...sad |
You can also try running the tracking script non async/deferred as explained here: https://developer.piwik.org/guides/ab-tests/browser This will slow down your site a bit but will make sure that piwik is loaded before the error occurs. |
@wei1215583760 just below the opening |
maybe now that we have a documentation on how to run piwik non-asynchronous, we should maybe we should also document this feature. (And warn about the performance decline) |
Yes, but asynchronous method did not work for error tracking in my case. Maybe this case will be a good guide for other users |
If i want to make sure where the error happened, i need to know the accurate message |
@tsteur do you know how to track full trace back using js? If there are some errors, I want to find it more easily with trace back information. |
@wei1215583760 Check https://github.com/piwik/piwik/blob/3.x-dev/js/piwik.js#L6500-L6543 At least in chrome (I am not sure about other browsers) the stacktrace should be accessable via https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Stack |
again |
They're stored as Actions in log_link_visit_action and log_action tables see: https://developer.piwik.org/guides/persistence-and-the-mysql-backend#action-types |
Hey @Findus23, I wanted to know if the latest version of matomo can print the stack trace or not. I couldn't find much documentation regarding this. Also, I've seen that Thanks |
@nvinayvarma189 |
Documented this feature in: https://matomo.org/faq/how-to/how-do-i-enable-basic-javascript-error-tracking-and-reporting-in-matomo-browser-console-error-messages/ Noted the two main limitations i'm aware of at the end:
|
Will close this for now. If you use this feature, please open new issues for specific feedback. |
Using the new powerful Event Tracking functionality, we can implement Javascript Errors Tracking within piwik.js.
The goal of this feature is to keep track automatically of any javascript errors or exception that happen during the rendering of the page, or any time after the initial rendering.
There are lots of tools that provide Error tracking and we would like to implement a basic, yet useful, alternative as part of Piwik Data Analytics platform!
Todo
The text was updated successfully, but these errors were encountered: