JavaScript error tracking
Datasense records uncaught exceptions, promise rejections, failed assets and console.error from real browsers, grouped with stack, page and browser.
Error tracking is on by default. The script that counts your visitors also records errors from their browsers, so there's no second SDK.
What's captured
| Kind | When |
|---|---|
error |
An uncaught exception, with stack, file, line and column. |
unhandledrejection |
A promise rejected with no handler. |
resource |
A script, image or stylesheet failed to load. |
console.error |
Any console.error(...) call, with a stack. |
Errors with the same kind and message are grouped, with counts, affected visitors, pages, browsers, and first and last seen. New ones appear live on the Errors page.
Limits
- Each site keeps its latest 100 errors: it's for noticing breakage next to traffic, not a full error tracker.
- At most 25 errors per page load; repeats within 5 seconds are dropped.
- Messages are cut at 500 characters and stacks at 4,000.
- Browser errors only.
Turn it off
html
<script
defer
data-track-errors="false"
data-website-id="YOUR_SITE_ID"
src="https://usedatasense.com/js/script.cookies.js"
></script>Read errors programmatically with the errors endpoint.