Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Session replay scripts slowing your site: Hotjar, Clarity fix

PRF-044Medium impactCould addBy FunnelGuardPublished Updated
On this page

What this issue is

A session-replay script records how visitors use your site: clicks, scrolls, typing and page changes. To rebuild the visit later, it takes a snapshot of the page and then observes every change to the page structure (the DOM, the tree of elements the browser draws).

All of that work runs on the main thread, the single lane where the browser also handles clicks, runs your own JavaScript and paints the screen. If the recorder is busy serialising a big page, a click has to wait. That wait shows up as a poor INP (Interaction to Next Paint, the Core Web Vital that measures how fast the page responds after a tap or click).

The effect is largest on pages with many elements, live-updating widgets, long product lists, animated sliders and multi-step forms, and on slower phones.

Why it costs you leads or sales

When the main thread is busy, the visitor taps your submit or add-to-cart button and nothing seems to happen. Some tap again, some double-submit, and some leave. Typing in form fields can also lag, which feels broken on mobile.

There is an irony here: the tool you installed to find out why people drop off can itself be a reason they drop off. The cost is usually modest on simple pages and larger on complex ones, so measure before you remove anything.

How a recorder delays a click
  1. Page loadsReplay script starts a full DOM snapshot
  2. Visitor taps SubmitClick waits for the main thread
  3. No visible reactionButton looks frozen
  4. Lead or saleVisitor leaves or taps repeatedly

The click is queued behind the recorder's work, so the visitor sees no reaction and may leave.

A busy main thread freezes the page

The recorder's work blocks the response to the click.

How to check if your site has it

Measure the recorder's main-thread cost
  1. Record a profile

    Open the page in Chrome, press F12, go to the Performance tab, enable 4x CPU slowdown, click Record, interact with your form or button, then stop.

  2. Find the script

    In the Bottom-Up or Call Tree view, group by domain or look for hotjar.com, clarity.ms or fullstory.com. Note the total time and any tasks over 50 ms.

  3. Compare with and without

    Right-click the recorder's request in the Network tab and choose Block request URL, reload and record again. Compare the long tasks and the delay after your click.

  4. Check real-user data

    In PageSpeed Insights or Search Console's Core Web Vitals report, see whether INP is over 200 ms. Chrome's Lighthouse report lists third-party cost under the third-party summary audit.

How to fix it

You rarely need to drop the tool. Reduce how much it records and when it starts.

Lower the recorder's cost
  1. Sample your traffic

    Recording every visitor is rarely needed. In the tool's settings, cap the daily sessions or record a percentage of visitors. Fewer recorded sessions means less work for most visitors.

  2. Load it after the page is usable

    Start the script after the window load event or after the first user interaction, instead of in the head. You lose the first moments of some sessions, which is usually acceptable.

  3. Limit it to pages you study

    Run it on the landing pages and funnels you are analysing. Leave it off pages that are very large or interactive, such as checkout, if it is hurting them.

  4. Mask or exclude heavy areas

    Use the tool's suppression or masking options for large, constantly changing elements like live tickers, carousels or chat widgets. Fewer observed changes means less work.

  5. Remove duplicates

    If you run two recorders, or the same one is installed via both a plugin and a tag manager, keep one.

  6. Re-measure

    Repeat the DevTools profile and compare long tasks and INP with your earlier numbers.

Delay the script by platform
  1. Change the trigger

    Open the tag for Hotjar, Clarity or FullStory. Replace the All Pages trigger on Page View or Initialization with a Window Loaded trigger, or a custom trigger that fires after a first click or scroll.

  2. Restrict pages

    Add a trigger condition on Page Path to include only the pages you want recorded, or add an exception for checkout.

  3. Preview and publish

    Use Preview mode to confirm the tag fires later, then publish.

Load a recorder after the page is usablejavascript
(function () {
  var loaded = false;
  function loadRecorder() {
    if (loaded) return;
    loaded = true;
    // Paste your vendor's original snippet here,
    // or inject its script URL:
    var s = document.createElement('script');
    s.async = true;
    s.src = 'YOUR_VENDOR_SCRIPT_URL';
    document.head.appendChild(s);
  }
  ['pointerdown', 'keydown', 'scroll'].forEach(function (e) {
    window.addEventListener(e, loadRecorder, { once: true, passive: true });
  });
  window.addEventListener('load', function () {
    setTimeout(loadRecorder, 3000);
  });
})();
Recorder loading approach

Before

  • Snippet in the head on every page
  • 100% of visitors recorded
  • Long tasks right after load
  • Slow response on first click

After

  • Loads after the page is usable
  • Sampled sessions, key pages only
  • Fewer and shorter long tasks
  • Clicks respond quickly
Main-thread time from the recorderExample numbers
Main-thread time from the recorder (example)Before: 420 ms; Delayed: 180 ms; Delayed + sampled: 90 ms016132242018090BeforeDelayedDelayed + sampledms

Example: illustrative blocking time on a throttled phone profile before and after sampling and delayed loading.

How to confirm it's fixed

Confirmation checks
  • A new DevTools profile shows fewer and shorter long tasks from the recorder's domain
  • Clicking the submit or add-to-cart button gives instant visual feedback with 4x CPU slowdown
  • Typing in form fields feels smooth
  • The recorder still captures sessions in its dashboard for the pages you chose
  • Field data for INP trends down over the following weeks in PageSpeed Insights or Search Console
  • Form submissions and conversion tracking still work

How to prevent it happening again

Habits that keep it under control
  • Keep one recorder installed, not three
  • Review the sampling rate and page list each quarter
  • Re-profile key pages after adding any new script or widget
  • Ask for a short test on a throttled device before a new tool goes live
  • Remove the tool when nobody is watching the recordings
  • Track INP in Search Console so a regression is visible

How FunnelGuard handles this

FunnelGuard does not check for this yet. Measuring how much main-thread time a session-replay script uses is a possible future check, but it is not something the service does today.

What FunnelGuard does do is run your real journeys on a schedule, such as a lead form or checkout, and check each step, the tracking hits sent to platforms like GA4, Google Ads and Meta, and whether test leads reach your inbox and CRM. If a heavy script ended up breaking a step, for example a button that never completes the journey, the failed step would show up in that run. It would not tell you that a replay tool was the cause of slowness.

To watch for this yourself, use Chrome DevTools Performance profiles with CPU throttling, the Lighthouse third-party audit, and the Core Web Vitals report in Search Console. Repeat after any change to your scripts. You can also start with the free read-only website audit or the Free plan (1 site, 2 journeys, daily checks, no card) to keep your key journeys covered.

Questions people ask

Does Hotjar slow down my website?

It can. Hotjar runs JavaScript on the main thread to record page changes, which can delay clicks on heavy pages or slow phones. The effect varies by page, so profile it in Chrome DevTools with and without the script blocked.

Does Microsoft Clarity affect Core Web Vitals?

Clarity is a session-replay script too, so it can add main-thread work and affect INP, especially on large or fast-changing pages. Measure it with a DevTools profile and compare with the script blocked. Delaying its load and sampling sessions can reduce the cost.

How do I stop a session replay tool hurting INP?

Load it after the page is usable, record only a sample of visitors, limit it to the pages you study and mask large, constantly changing elements. Then re-profile and compare long tasks. Remove it if nobody uses the recordings.

How can I tell if FullStory is causing long tasks?

Record a Performance profile in Chrome DevTools with CPU slowdown on, then look for tasks over 50 ms from fullstory.com in the Bottom-Up view. Block its request, record again and compare the results.

Is it safe to delay Hotjar or Clarity until the user interacts?

Yes, usually. You may miss the first seconds of some sessions, but the page responds faster. Use the vendor's own snippet inside your loader and check that recordings still appear in the dashboard.

Should I run session replay on checkout pages?

Only if you need it. Checkout pages are sensitive to delay and hold personal and payment data, so many teams keep recorders off them or use strict masking. Check your tool's privacy settings and your consent rules.

Does FunnelGuard detect session replay scripts slowing my site?

No, not yet. It is a possible future check. FunnelGuard does run your real journeys on a schedule and checks each step, tracking hits and lead delivery, so a step that fails would show up, but not the cause as a replay script.

Does FunnelGuard catch this?

Could add

Not checked yet: could be added to FunnelGuard.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.