UIGuides

How to Set Up Hotjar

6 min read

Step-by-step guide to setting up Hotjar for heatmaps, session recordings, feedback surveys, and funnels. Covers installation, privacy controls, and what to look for.

Hotjar gives you behavioral data about your live product that analytics alone can't give you. Where Google Analytics tells you users dropped off at step 3, Hotjar shows you what they were doing when they left.

Here's how to set it up and actually use it.

Installing the tracking code

You have two options: direct install or Google Tag Manager.

Direct install: Add the Hotjar tracking snippet to the <head> of every page on your site. In most frameworks (Next.js, Gatsby, etc.) this goes in your root layout file. Hotjar generates the snippet for you in Settings → Tracking Code.

Google Tag Manager: If your site already uses GTM, this is cleaner. Create a new Custom HTML tag in GTM, paste the Hotjar snippet, and set the trigger to "All Pages." GTM is better if multiple people manage tracking — one place to add, update, and remove tags.

After installing, use Hotjar's verification tool in the dashboard to confirm the script is firing. Give it 15-30 minutes after installation.

One note: Hotjar only works on public pages by default. Pages behind authentication require additional setup — you'll need to add the snippet to authenticated pages and configure Hotjar to track logged-in users (using user identification if on a paid plan).

Setting up heatmaps

Go to Heatmaps → New Heatmap. Specify the URL or URL pattern you want to track.

What to track: Prioritize high-traffic, high-stakes pages. Your homepage, main landing pages, key product pages, and checkout or sign-up flows. Don't set up heatmaps on every page — you'll generate more data than you can analyze.

URL matching: Use "contains" rules for parameterized URLs. If your product pages are /products/[id], set the heatmap to match URLs containing /products/ rather than trying to track each one individually.

Hotjar generates three heatmap types:

  • Click maps: Where users click (or tap on mobile)
  • Move maps: Where users move their cursor (roughly correlates to attention on desktop)
  • Scroll maps: How far down the page users scroll

Scroll maps are the most actionable. If 70% of users never scroll past your hero section, anything below it is invisible to most visitors.

Wait until you have at least 1,000 sessions on a page before drawing conclusions from heatmap data.

Session recording setup

Session recordings capture video of individual user sessions — mouse movements, clicks, scrolls, and form interactions.

Sampling: On a high-traffic site, recording every session is wasteful and expensive. Set a sampling rate (20-50% is reasonable for most sites). Hotjar's paid plans let you filter recordings by URL, device type, referral source, and more.

Privacy controls for PII: This is critical. Hotjar masks input fields by default, but you should audit this. Go to Settings → Privacy and review what's being masked. Fields that capture names, emails, passwords, and credit card numbers must be suppressed. Use Hotjar's element masking to add additional fields if needed.

Check your privacy policy — recording user sessions may have disclosure requirements in your region. Most SaaS companies add a line about behavioral tracking tools to their privacy policy.

What to look for in recordings: Rage clicks (repeated fast clicks on an element), u-turns (going back immediately after landing on a page), dead-end scrolling (users scrolling back and forth looking for something), and form abandonment patterns.

Set up Hotjar for your site

Feedback surveys

Hotjar has two survey types that are genuinely useful:

On-page polls: Short 1-2 question surveys triggered at a specific moment (on page load, after X seconds, on exit intent, after a specific interaction). Use these to ask "What stopped you from completing your purchase today?" on your checkout page, or "What were you looking for?" when someone searches and finds nothing.

NPS surveys: Net Promoter Score surveys sent to users after a key milestone (sign-up, first completed task, after X days of use). Target by user behavior using Hotjar's triggers, not just by timing.

Keep surveys to 1-2 questions. Response rates drop sharply with longer surveys. A survey that gets 200 responses to one question is more useful than a survey that 10% of users complete.

Setting up funnels

Funnels show you where users drop off across a multi-step flow (sign-up, checkout, onboarding).

Create a funnel by defining each step as a URL. Hotjar will show you the drop-off rate between each step and let you click into session recordings for users who dropped off at a specific point.

The most useful thing about funnels isn't the drop-off percentage — it's the ability to filter recordings by where users exited. If 40% of users drop off at step 2 of your checkout, watch 20 session recordings of those specific users. The pattern usually becomes obvious.

Analyzing your first week of data

After one week with Hotjar running, here's what to look at:

Scroll maps on key landing pages. What percentage of users reach your CTA? If it's below 50%, consider moving it higher.

Click maps on your navigation. Are users clicking things that aren't clickable? Are they ignoring key navigation items?

Session recordings filtered to mobile. Mobile experiences often have undiscovered issues that desktop testing misses. Watch 10 mobile sessions on your most important pages.

Funnel drop-offs. Look at the biggest single drop-off point and watch recordings of users who exited there.

Document your findings in Notion. Screenshots from Hotjar with annotations explaining what you're seeing and what you'd test or fix are a useful deliverable for stakeholders.

Document Hotjar findings in Notion

What to ignore

Single session anomalies. One recording of a confused user isn't a finding. Look for patterns across sessions.

Move maps as a proxy for attention. Cursor movement data on desktop is noisy. Use it as supplementary signal, not primary evidence.

Low-traffic page data. Don't draw conclusions from a heatmap with 50 sessions. Wait for meaningful volume.

Your own behavior. Exclude your IP address in Hotjar's settings (Site Settings → Exclude Traffic) so your own usage doesn't skew the data.

Hotjar is most valuable when you use it to generate specific hypotheses, then test those hypotheses with a prototype test or A/B test. Don't treat it as a replacement for talking to users.