Available on Observe plans.
The console tracking feature captures JavaScript console errors that your users are experiencing during a session. You can view console errors alongside a recording playback or apply an Error filter to refine your session data based on console errors. This enables you to identify issues on your site, investigate the cause, and prioritize a fix.
All sites initially have console tracking turned off by default. After a team member with Admin permissions has turned on console tracking in your site settings, future sessions will begin capturing console logs.
This article will cover the following:
- How to turn console tracking on and off
- How to view errors in the Recordings player console
- How to apply the Error filter to your Recordings list
- What types of errors are captured
- FAQs for console tracking
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.
How to turn console tracking on or off
Admin permissions are required to make changes to console tracking
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.
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 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.
How to apply the Error filter to your Recordings list
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 types of errors are captured
We're currently capturing uncaught JavaScript errors that have been thrown via:
-
window.addEventListener('error', errorCapture.onError);
This occurs 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.
-
window.addEventListener('unhandledrejection', errorCapture.onUnhandledRejection);
This can occur when a JavaScript Promise that has no rejection handler is rejected.
FAQs for console tracking
What happens to console tracking if I downgrade my plan?
When downgrading to a plan that doesn't support this feature, console tracking will stop and error capturing will no longer be available for you to use in Hotjar. The console tracking option will remain activated in your site settings. This means that if you upgrade again, console tracking would also restart without needing to change your site settings.