Skip to main content

Open-source alternatives guide

Best Open Source Alternatives to Hotjar in 2026

Hotjar costs $32-171/month. These open source heatmap and session replay tools give you user behavior insights for free — OpenReplay, Microsoft Clarity.

·OSSAlt Team
Share:

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.

Analytics Replacements Should Be Judged on Decision Quality

Analytics tools are easy to compare on dashboard screenshots and event volume pricing, but the better measure is whether they improve decision quality without increasing data risk. Teams should ask how events are defined, whether sampling or retention defaults hide important behavior, and how quickly a non-analyst can answer a real product or growth question. If the replacement requires a specialist for every query, it may be cheaper than enterprise analytics software yet still expensive in practice because insight latency stays high.

This is where adjacent tools matter. Plausible guide is useful when the goal is privacy-first product and marketing analytics without a surveillance-heavy stack. Prometheus and Grafana guide becomes relevant when operational metrics and application health need to sit beside product events for a fuller picture. Uptime Kuma guide fits because customer experience starts with availability, not just funnel conversion. Together, those tools create a more honest view of product behavior than a single script-heavy analytics platform pretending to be a universal observability layer.

How to Avoid Recreating the Worst Parts of SaaS Analytics

The other trap is copying SaaS analytics habits without questioning them. Many organizations collect more events than they can govern, retain them longer than necessary, and send them to third parties by default. A self-hosted analytics stack is a chance to narrow scope. Track the events that support concrete decisions, remove identifiers you do not need, define retention with legal and product stakeholders, and make event ownership explicit in code review. That keeps the data model maintainable and makes privacy claims easier to defend.

For articles about alternatives to Mixpanel, Amplitude, Segment, or Hotjar, this operational framing matters because the migration is not only a tooling switch. It is a chance to rebuild measurement discipline. The strongest replacement is the one that gives the team faster answers with fewer blind data pipelines and less external exposure.

Decision Framework for Picking the Right Fit

The simplest way to make a durable decision is to score the options against the constraints you cannot change: who will operate the system, how often it will be upgraded, whether the workload is business critical, and what kinds of failures are tolerable. That sounds obvious, but many migrations still start with screenshots and end with painful surprises around permissions, backup windows, or missing audit trails. A short written scorecard forces the trade-offs into the open. It also keeps the project grounded when stakeholders ask for new requirements halfway through rollout.

One more practical rule helps: optimize for reversibility. A good self-hosted choice preserves export paths, avoids proprietary lock-in inside the replacement itself, and can be documented well enough that another engineer could take over without archaeology. The teams that get the most value from self-hosting are not necessarily the teams with the fanciest infrastructure. They are the teams that keep their systems legible, replaceable, and easy to reason about.

Analytics Replacements Should Be Judged on Decision Quality

Analytics tools are easy to compare on dashboard screenshots and event volume pricing, but the better measure is whether they improve decision quality without increasing data risk. Teams should ask how events are defined, whether sampling or retention defaults hide important behavior, and how quickly a non-analyst can answer a real product or growth question. If the replacement requires a specialist for every query, it may be cheaper than enterprise analytics software yet still expensive in practice because insight latency stays high.

This is where adjacent tools matter. Plausible guide is useful when the goal is privacy-first product and marketing analytics without a surveillance-heavy stack. Prometheus and Grafana guide becomes relevant when operational metrics and application health need to sit beside product events for a fuller picture. Uptime Kuma guide fits because customer experience starts with availability, not just funnel conversion. Together, those tools create a more honest view of product behavior than a single script-heavy analytics platform pretending to be a universal observability layer.

How to Avoid Recreating the Worst Parts of SaaS Analytics

The other trap is copying SaaS analytics habits without questioning them. Many organizations collect more events than they can govern, retain them longer than necessary, and send them to third parties by default. A self-hosted analytics stack is a chance to narrow scope. Track the events that support concrete decisions, remove identifiers you do not need, define retention with legal and product stakeholders, and make event ownership explicit in code review. That keeps the data model maintainable and makes privacy claims easier to defend.

For articles about alternatives to Mixpanel, Amplitude, Segment, or Hotjar, this operational framing matters because the migration is not only a tooling switch. It is a chance to rebuild measurement discipline. The strongest replacement is the one that gives the team faster answers with fewer blind data pipelines and less external exposure.

Analytics Governance Notes

Analytics governance should define event ownership, retention, identifier minimization, and a standard review path for schema changes. That discipline keeps the measurement layer trustworthy as more teams depend on it.

Analytics Replacements Should Be Judged on Decision Quality

Analytics tools are easy to compare on dashboard screenshots and event volume pricing, but the better measure is whether they improve decision quality without increasing data risk. Teams should ask how events are defined, whether sampling or retention defaults hide important behavior, and how quickly a non-analyst can answer a real product or growth question. If the replacement requires a specialist for every query, it may be cheaper than enterprise analytics software yet still expensive in practice because insight latency stays high.

This is where adjacent tools matter. Plausible guide is useful when the goal is privacy-first product and marketing analytics without a surveillance-heavy stack. Prometheus and Grafana guide becomes relevant when operational metrics and application health need to sit beside product events for a fuller picture. Uptime Kuma guide fits because customer experience starts with availability, not just funnel conversion. Together, those tools create a more honest view of product behavior than a single script-heavy analytics platform pretending to be a universal observability layer.

How to Avoid Recreating the Worst Parts of SaaS Analytics

The other trap is copying SaaS analytics habits without questioning them. Many organizations collect more events than they can govern, retain them longer than necessary, and send them to third parties by default. A self-hosted analytics stack is a chance to narrow scope. Track the events that support concrete decisions, remove identifiers you do not need, define retention with legal and product stakeholders, and make event ownership explicit in code review. That keeps the data model maintainable and makes privacy claims easier to defend.

For articles about alternatives to Mixpanel, Amplitude, Segment, or Hotjar, this operational framing matters because the migration is not only a tooling switch. It is a chance to rebuild measurement discipline. The strongest replacement is the one that gives the team faster answers with fewer blind data pipelines and less external exposure.

The SaaS-to-Self-Hosted Migration Guide (Free PDF)

Step-by-step: infrastructure setup, data migration, backups, and security for 15+ common SaaS replacements. Used by 300+ developers.

Join 300+ self-hosters. Unsubscribe in one click.