Skip to main content

Best Open Source Alternatives to Hotjar in 2026

·OSSAlt Team
hotjarheatmapssession-replayux-analyticsself-hostedopen-source2026

TL;DR

Hotjar's paid plans start at $32/month and scale based on sessions. For what it does — heatmaps, session replays, surveys, and feedback widgets — the OSS landscape has strong alternatives. OpenReplay is the best self-hosted session replay tool (more powerful than Hotjar for developer use). Microsoft Clarity is free (not OSS, but zero cost). Rrweb is the OSS session recording library if you want to build your own. For heatmaps specifically: Smartlook has a free tier, and self-hosted heatmaps are achievable with rrweb + custom analysis.

Key Takeaways

  • Hotjar pricing: $32/month (Observe), $171/month (Business) — scales with sessions
  • OpenReplay: most powerful self-hosted session replay — includes error tracking, network requests
  • Microsoft Clarity: free, cloud-hosted heatmaps + session replay — not OSS but zero cost
  • Rrweb: OSS session recording library — build your own replay tool
  • PostHog: includes session replay as part of broader product analytics
  • Privacy advantage: self-hosted means GDPR compliance without cookie banners

What Hotjar Does

Hotjar's feature set:

  • Heatmaps: click, move, and scroll heatmaps showing where users interact
  • Session recordings: watch real user sessions (mouse, clicks, scrolls)
  • Surveys: NPS surveys, popup questions embedded in your app
  • Feedback widgets: "Rate this page" buttons, open-ended feedback
  • Funnels: basic conversion funnel from behavior data

The most-used features are session recordings and heatmaps — these are the primary things teams pay for.


The Alternatives

1. OpenReplay — Best Self-Hosted Session Replay

Best for: Engineering teams who need session replay with developer-focused features (network inspection, console logs, errors).

OpenReplay is more technical than Hotjar — it records sessions with full DOM replay AND captures: network requests, console logs, JavaScript errors, Redux store changes. It's what developers actually want.

# Self-host with Kubernetes (recommended for production):
git clone https://github.com/openreplay/openreplay
cd openreplay/scripts/helm
./install.sh  # Follow prompts for domain setup

# Or quick Docker start:
docker run -d \
  --name openreplay \
  -p 9001:9001 \
  openreplay/openreplay-ee:latest

Integration (replaces Hotjar tracking code):

import OpenReplay from '@openreplay/tracker';
import trackerAssist from '@openreplay/tracker-assist'; // co-browse
import trackerRedux from '@openreplay/tracker-redux';   // Redux state

const tracker = new OpenReplay({
  projectKey: 'your-key',
  ingestPoint: 'https://your-openreplay.company.com/ingest',
  defaultInputMode: 1, // 0=plain, 1=obscured, 2=ignored (for privacy)
  obscureInputNumbers: true,  // Hide CC numbers, etc.
  obscureInputEmails: true,
});

// Redux integration — see state changes in session replay:
const reduxMiddleware = trackerRedux(tracker);
const store = configureStore({ middleware: [reduxMiddleware] });

// Start recording:
tracker.start();

// Tag sessions for search:
tracker.setUserID(user.id);
tracker.setMetadata('plan', user.plan);
tracker.setMetadata('company', user.company);

OpenReplay features vs Hotjar:

FeatureHotjarOpenReplay
Session replay
Heatmaps
Network requests in replay
Console logs in replay
JS error tracking
Redux/Zustand state
Co-browse (support)
Surveys
Self-hosted

GitHub: openreplay/openreplay — 9K+ stars


2. Microsoft Clarity — Free (Not OSS, But $0)

Best for: Teams who want Hotjar-level features at zero cost and don't need self-hosting.

Microsoft Clarity is genuinely free — no session limits, no paid tiers. It includes heatmaps, session recordings, and basic behavior analytics.

<!-- Add to your site (like Hotjar): -->
<script type="text/javascript">
(function(c,l,a,r,i,t,y){
    c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
    t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
    y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "YOUR_PROJECT_ID");
</script>

// Track custom events:
clarity("set", "plan", user.plan);
clarity("set", "user_id", user.id);

Clarity features:

  • Unlimited session recordings
  • Click, scroll, and area heatmaps
  • Dead click and rage click detection
  • Session filters (URL, browser, device, custom metadata)
  • Integration with Google Analytics

The catch: your data goes to Microsoft. For GDPR-sensitive apps, self-hosted OpenReplay is better.


3. Rrweb — Build Your Own

Best for: Developer teams who want full control and want to build session replay into their product.

Rrweb (Record and Replay the Web) is the underlying recording library that most tools (including Hotjar internally) build on. It's OSS, tiny, and lets you implement session replay exactly as you need.

// Install:
npm install rrweb

// Record sessions:
import { record } from 'rrweb';

let events: eventWithTime[] = [];

const stopRecording = record({
  emit(event) {
    events.push(event);
    // Send to your backend every 5 seconds:
    if (events.length > 100) {
      sendEvents(events.splice(0));
    }
  },
  // Privacy: mask sensitive inputs:
  maskAllInputs: true,
  maskInputOptions: { password: true, email: true },
  // Block specific elements:
  blockClass: 'sensitive-data',
});

// Replay sessions:
import { Replayer } from 'rrweb';

const replayer = new Replayer(events, {
  root: document.getElementById('replay-container'),
});
replayer.play();

// Add rrweb player UI:
import 'rrweb-player/dist/style.css';
import rrwebPlayer from 'rrweb-player';

new rrwebPlayer({
  target: document.getElementById('player'),
  props: {
    events,
    showController: true,
    autoPlay: false,
    skipInactive: true,
  },
});

Store events in ClickHouse or Postgres:

CREATE TABLE session_events (
  session_id  UUID,
  user_id     VARCHAR(255),
  timestamp   BIGINT,
  event_type  SMALLINT,
  event_data  JSONB,
  created_at  TIMESTAMPTZ DEFAULT NOW()
);

-- Query sessions with errors:
SELECT DISTINCT session_id, user_id
FROM session_events
WHERE event_data->>'type' = '2'  -- console error
  AND created_at > NOW() - INTERVAL '7 days';

GitHub: rrweb-io/rrweb — 17K+ stars


4. PostHog — Session Replay Included

Best for: Teams who want session replay as part of a broader product analytics platform.

PostHog includes session replay at no extra cost — it's included in the OSS self-hosted version. Unlike Hotjar (behavior-focused), PostHog gives you:

import posthog from 'posthog-js';

posthog.init('your-key', {
  api_host: 'https://your-posthog.company.com',
  session_recording: {
    recordCanvas: true,      // Record canvas elements
    maskAllInputs: true,     // Privacy: mask inputs by default
    maskInputFn: (text, element) => {
      // Custom masking logic:
      if (element.type === 'email') return '*****@*****.***';
      return text;
    },
  },
});

PostHog's session replay differentiator: sessions are linked to your analytics events. Click a user in a funnel analysis → watch their session replay directly.


Heatmaps: The Gap

Hotjar's heatmaps (click density, scroll depth, move maps) don't have a perfect OSS equivalent. Options:

// DIY click heatmap with rrweb + visualization:
// 1. Record click events (rrweb captures these)
// 2. Export click positions normalized to page dimensions
// 3. Render with heatmap.js (OSS):
import h337 from 'heatmap.js';
const heatmapInstance = h337.create({ container: document.body });
heatmapInstance.setData({
  max: 100,
  data: clickData.map(c => ({ x: c.x, y: c.y, value: 1 })),
});

// Or use Microsoft Clarity (free) for heatmaps
// while using OpenReplay (self-hosted) for session replay

The most practical approach for most teams: use Clarity (free) for heatmaps and OpenReplay (self-hosted) for session replay.


Privacy and GDPR

This is where self-hosted options genuinely win:

Hotjar:
→ Stores session data on Hotjar servers
→ Hotjar is a "data processor" under GDPR
→ Requires cookie consent banner
→ Data in EU? Hotjar uses AWS in EU but terms allow US transfer

OpenReplay self-hosted:
→ All data on YOUR servers
→ You are the data controller AND processor
→ No cookie consent required for performance monitoring
→ No third-party data sharing
→ GDPR Article 28 compliance with zero paperwork

For products handling EU user data, self-hosted OpenReplay eliminates the compliance complexity of Hotjar.


Cost Comparison

ToolCostSessionsSelf-Hosted
Hotjar Observe$32/month35 recordings/day
Hotjar Business$171/monthUnlimited
Microsoft Clarity$0Unlimited
OpenReplay self-hosted~$20/month VPSUnlimited
PostHog self-hosted~$40/month VPSUnlimited
Rrweb + own backend~$10/monthUnlimited

Explore more open source alternatives at OSSAlt.

Comments