Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does HotJar generate their recordings?

Tags:

Tracking mouse movement/scroll/click events is easy but how do they save the screen and keep it in sync so well?

The pages are rendered very quite well (at least for static HTML pages, haven't tested on Angular or any SPA), the sync is almost perfect.

To generate and upload a 23fps recording of my screen (1920x1080) it would take about 2Mbps of bandwidth. Maybe when recording only when there are some mouse events it would still take some 300-500Kbps on average? That seems way too much...

like image 520
Nick M Avatar asked Oct 28 '16 13:10

Nick M


People also ask

Does Hotjar record every session?

Hotjar captures the majority of user sessions in Heatmaps and Recordings, depending on your Observe plan's daily session limits.

How does Hotjar collect data?

When you use Hotjar to record and collect data from your site, Hotjar takes on the role of the Data Processor. This means Hotjar is processing data on your behalf whereas you are the owner and Controller of the data.

What is Hotjar and how does it work?

Hotjar is a powerful tool that reveals the online behavior and voice of your users. By combining both Analysis and Feedback tools, Hotjar gives you the 'big picture' of how to improve your site's user experience and performance/conversion rates.

How long does it take for a Hotjar recording to show up?

You can expect to start seeing results within 60 minutes. Four things can have an impact on how quickly you begin seeing results: Processing time: Our systems will typically process data within 15 minutes, but can take up to 60 minutes.


Video Answer


1 Answers

HTML content and DOM changes get pumped through a websocket and stored by Hotjar (minus sensitive information such as form inputs from the user, unless you've whitelisted them), the CSS isn't stored (it gets loaded by you when you watch the recording).

Because they're only recording user activity and DOM changes, there's a lot less data to record than if they were capturing a full video. The downside is that some Javascript driven widgets won't function correctly in the replay.

Relevant information from Hotjar docs:

  • When it comes to recordings, changes to the page are captured using the MutationObserver API which is built-in into every modern browser. This makes it efficient since the change itself is already happening on the page and the browser MutationObserver API allows us to record this change which we then parse and also send through the websocket.
  • At regular short intervals, every 100ms or 10 times per second, the cursor position and scroll position are recorded. Clicks are recorded when they happen, capturing the position of the cursor relative to the element being clicked. These are functions which in no way hinder a user's experience as they only capture the location of the pointer when a click happens or every 100ms. The events are sent to the Hotjar servers through frames within the websocket, which is more efficient than sending XHR requests at regular intervals.

Source: https://help.hotjar.com/hc/en-us/articles/115009335727-Will-Hotjar-Slow-Down-My-Site-

like image 55
William Avatar answered Sep 18 '22 16:09

William