What is JavaScript?
JavaScript is a development language that powers 95% of all web pages on the internet. The standard page downloads an average of 20 JavaScript files per view.
The JavaScript is processed by a user's browser when they visit a page on your website. If the code contains mistakes, a JavaScript error will occur. A Script error is the most common type of JavaScript error, you can read more here.
Errors are not always visible to users on your site's front-end, but when they are, users can encounter:
-
Error messages
-
Pages not loading at all
-
Long load times
-
Unresponsive CTAs
-
Empty dropdown menu
How JavaScript (JS) errors are collected
JS errors display format
JS errors are displayed in the following format: 'Error name: error message'.
Here are some examples:
Script error.
Uncaught TypeError: Cannot read property '0' of undefined
TypeError: this.stickyHeights is undefined
SecurityError: DOM exception 18: An attempt was made to break through
the security policy of the user agent
SyntaxError: expected expression, got end of script
Errors collected per pageview
A maximum of 20 JS errors are collected per pageview.
How to read JS errors in the JS error analysis module
The Errors module in Contentsquare automatically tracks all JavaScript errors that users experienced during their visit.
In the error row displayed, you will see three lines of text for each JS error. These are the error's (or grouped error) details which allow you to differentiate the errors and identify their location.
- The first line displays the error type and the line and column in the file to help you located the error code.
- The second line displays the error name.
- The third line is the location of the script file that contains the error of the URL if the JS code is in line within the HTML code.
Note: A .js extension (at the end of the script file) may not always been visible if the page is built using certain Single-page-application frameworks.
The JS error analysis module surfaces these glitches and prioritizes them relative to your unique website KPIs.