Plan availability
Observe plan. Book a call with our Sales team, to learn more about plan features.
The console tracking feature captures JavaScript console errors that your users are experiencing during a session. This helps identify areas of friction and possible frustration points that your users are experiencing on your site.
You can view console errors alongside a recording playback and zoom out to view a trend or other recordings of the same error occurring to see if there's a more widespread issue. By applying an Error filter, you can also refine your session data based on console errors. Errors that occur on your site will be logged if console tracking is enabled in Hotjar, but will only be visible in Recordings while on a plan.
- How to turn console tracking on and off
- What types of errors are captured
- How to view errors in the Recordings player console
- How to apply the Error filter to your Recordings list
- FAQs for console tracking
How to turn console tracking on or off
To enable console tracking, which is off by default, Admin permissions are required.
You'll need to have Admin permission levels to turn console tracking on or off in your site settings. You can check which team members have the required Admin permission level by visiting your Team page.
Visit your Sites & Organizations page.
Click the site settings gear icon to visit your site settings page.
Click the Session targeting & tracking section on your site settings page.
Click Capture JavaScript errors and console logs to toggle this on or off, then click Save changes.
What types of errors are captured
Hotjar currently captures uncaught errors. These are errors that are not being handled by your site in any way. "Handling" an error means that your site sees the error, and takes action to prevent it from affecting the user's experience. Because of this, you may see errors on a page when looking in developer console that don't appear in Hotjar.
Hotjar currently uses an EventListener
to capture the following uncaught events:
This happens when there's been an error loading an external file or using a resource, such as an image, or if a script has an execution error.
Each error is an object based upon the Error
object, and has a name
and a message
.
Some examples are:
- Error: Permission denied to access property "x" - occurs when there was an attempt to access an object for which you have no permission.
- SyntaxError: illegal character - occurs when there is an invalid or unexpected token that doesn't belong at this position in the code.
- TypeError: "x" is not a function - occurs when there was an attempt to call a value from a function, but the value is not actually a function.
- Script error (a generic error, showing only a timestamp) - these errors are thrown by cross-origin scripts that the browser prevents capturing.
For a more comprehensive list, check out this JavaScript error reference
If an error condition arises inside a JavaScript promise, you can “reject” the promise by calling the reject() function. However, if this function isn't called, but the JavaScript promise is still rejected, this will result in an UnhandledRejection
event.
Your developer team will be able to set the rejection event message that appears in the Developer Console, but it may look something like:
- Uncaught (in promise) something went wrong
How to view errors in the Recordings player console
Visit your Recordings page.
Click Play on any recording in the playback list.
Inside the Recordings player, click the Open console icon to show the Recordings console.
In the Session Info tab, you can see if any console errors occurred in the current recording and the number of errors. You'll also be able to view these in the Recordings console above the playback timeline.
When you come across a console error on a recording playback, you can also view a trend or recordings of the same error occurring by clicking on the error icon in the playback toolbar and selecting View trend or the recordings play icon.
When console tracking is turned off, you'll see the message shown below asking you to activate console tracking. If you have Admin permission levels, clicking Switch on console tracking will turn console tracking on. To turn it off again, follow the steps in the How to turn console tracking on or off section above.
You can also create tasks based on console errors using the Jira, Trello or Asana integrations.
How to apply the Error filter to your Recordings list
Recordings data cannot be exported when an Error filter is applied
When an Error filter is applied to your Recordings Playback List, it's currently not possible to export this data. If you try to export Recordings data with the filter applied, you'll see the following message: Something went wrong. Please adjust your filters and retry.
The Error filter refines your session data based on whether a JavaScript console error occurred or did not occur. You can further refine this filter by specifying conditions for the error text and page URL. This includes whether the error text and page URL contains, is, is not, or does not contain. Currently, the Error filter is only available with the Recordings tool.
What happens to console tracking if I downgrade my plan?
When downgrading to a plan that doesn't support console tracking, error capturing will no longer work and no console information will be recorded. The console tracking option will be greyed out in your site settings, and the related checkbox will remain 'checked' or 'unchecked' based on what was configured at the time of the downgrade.
If you upgrade your Hotjar Site to an Observe BusinessObserve Scale plan in the future, the console tracking feature will resume based on your previously saved configurations. Console tracking will not work unless the Site is on an Observe BusinessObserve Scale plan, regardless of the greyed out configurations. Errors that occur while the site is on a different plan will not be recorded even if the checkbox is 'checked'.
Can I see an overview of all the errors occurring on my site?
There is not a complete list of all errors, but your Dashboards have a section where you can view the Top console errors occurring in your session data. This information is visible in bar/pie chart or line graph form.
Why do I see a "Script Error" message with no data?
"Script error" messages happen due to errors with cross-origin scripts. Since web browsers don't allow capturing of data from these cross-origin scripts, Hotjar can't see the root cause and will display a generic "Script error" message instead.
Why can't users that I share a recording with see console errors?
When sharing a recording, the viewer needs to be a Team Member in your Hotjar Organization for console errors to appear during playback. You can add the user to your Hotjar Organization by following the steps in our How to Add or Remove Team Members article.
From there, when sharing a recording with them, select the "Only team members on Hotjar can view" so that they'll be able to see console errors in the recording player: