hotjar website integration
Hotjar Website Integration: Setup Guide for Sites and Apps
Add the Hotjar tracking code to your site, verify it, and set up heatmaps and the feedback widget on websites and apps your AI assistant builds.
A Hotjar integration comes down to one script. You copy the tracking code, place it in the <head> of every page you want to measure, and check that data arrives. Then you turn on heatmaps and the feedback widget. On WebsitePublisher, the AI web platform for websites and apps, your AI assistant (ChatGPT, Claude, Gemini, Grok and others) builds and publishes through the WebsitePublisher connector. Every change goes live immediately, so you can add the snippet and verify it in the same sitting.
This guide walks through the full setup. It covers what to prepare, where the code goes, how to confirm it works, how to build your first heatmap and feedback widget, and what to check for privacy and speed.
TL;DR
- Hotjar needs one async script in the
<head>of each tracked page. Each Hotjar site gets its own unique snippet. - Hotjar is now part of Contentsquare, and new Hotjar accounts can no longer be created. New users sign up for Contentsquare, which carries over heatmaps, recordings, surveys and interviews.
- After installing, click Verify Installation, then browse your live site yourself. Session capture must be switched on.
- Mask sensitive fields manually, and measure page speed before and after the install.
- On the AI web platform, changes are live immediately, so install, verify and fix in one loop.
Table of Contents
- What to know before you start
- How the Hotjar tracking code works
- Step by step: add Hotjar to your website or app
- If Hotjar shows no data
- Set up heatmaps on your website
- Add the Hotjar feedback widget
- Privacy, masking and consent
- Check the speed impact
- Our perspective
- Build, measure and fix on one platform
- FAQ
- Sources
What to know before you start
Three things decide whether setup goes smoothly: access, an objective and an account.
Access. The tracking code cannot be installed without backend or code access. On our platform you have that access through your AI assistant and the visual browser editor, so there is no theme file to hunt for and no FTP login to find.
An objective. The same source advises starting with high-impact pages, such as the homepage, product pages or landing pages, and defining a clear goal first: more clicks, more form submissions or more sales. A heatmap with no question behind it is just a colorful picture.
An account. Hotjar Ltd was merged into the Contentsquare Group on 1 July 2025, and new Hotjar accounts are no longer created. New users sign up through Contentsquare and get the same core tools: heatmaps, session recordings, surveys and interviews. Existing Hotjar accounts are being moved to Contentsquare, and the existing tracking code keeps working, so there is no need to re-tag your site. Historical Hotjar data does not carry over, so export anything you want to keep. Either way, you end up with a site ID and a snippet.
How the Hotjar tracking code works
The standard snippet is an async script that loads from static.hotjar.com and has to be pasted into the <head> of every page you want tracked. Each site you add inside Hotjar gets its own snippet, so do not reuse one site’s code on another site.
That last point matters if you run several client sites. Create a separate Hotjar site per project and keep the site IDs in your project notes.
Developers who build apps with a JavaScript framework can use the official @hotjar/browser package. You initialize it with your site ID and a version number. It also supports identify and event calls, plus a state-change call for single-page apps where the route changes without a full page load. If your Content Security Policy is strict, the package documents a nonce option, and your policy needs to allow scripts from *.hotjar.com.
Step by step: add Hotjar to your website or app

1. Create the site in Hotjar
In your Hotjar or Contentsquare account, add a new site and enter your domain. Copy the tracking code shown on screen. Keep the tab open, because you will come back to verify.
2. Give the snippet to your AI assistant
Open the AI assistant you already use. It can be ChatGPT, Claude, Gemini, Grok or another one from our list of supported AI platforms. In ChatGPT, use the WebsitePublisher app (@WebsitePublisher), which works on ChatGPT Free and Plus. The assistant talks to WebsitePublisher through the MCP connector, the standard that lets AI assistants act on your project. Paste the snippet and ask for it to be placed in the <head> of every page you want tracked.
A prompt that works:
Add this Hotjar tracking code to the head of my homepage, pricing page and contact page. Here is the snippet: [paste].
Name the pages. Starting with a few high-value pages keeps your first dataset readable.
3. Check the page is live
Because WebsitePublisher has no separate deploy step, the change is live as soon as your assistant makes it. Open your site in a normal browser window and load the page you edited. If you use a custom domain, load the page on that domain, so the visit matches the domain you registered in Hotjar.
4. Click Verify Installation
Return to the Hotjar dashboard and click Verify Installation. A successful check shows a green check mark and can take a few minutes. Hotjar also checks the install on its own, typically within a few minutes of your first visit.
5. Turn on session capture
The snippet alone does not start recordings. Session capture must be switched on for the site. A yellow banner saying capture is disabled is the usual reason for an empty recordings list.
If Hotjar shows no data
Work through this list in order:
- Visit a real page. You need an actual pageview. Use a normal browser without an ad blocker and accept analytics cookies if a banner appears.
- Check the site ID. A wrong ID sends data nowhere.
- Look for duplicates. Two copies of the snippet cause trouble. Ask your assistant to list where the code appears.
- Check consent tooling. A cookie banner or consent mode can block the script until a visitor agrees.
- Check URL rules. Capture rules in Hotjar can exclude the page you are testing.
- Wait. Hotjar’s own guidance, as relayed by DevMixa, is to wait up to 12 hours with capture on before deeper troubleshooting.
Other causes include hitting the monthly session cap and very low traffic. If your site has had five visitors this week, an empty report is normal.
One more trap: do not test while logged in to an admin area. Some setups skip tracking for logged-in users, and stale cached pages can hide a fresh install. Test as an ordinary visitor.
Set up heatmaps on your website
Once the code is installed, heatmaps are generated automatically for pages that receive traffic. You can also create a named one for a specific page:
- Click + New Heatmap and name it after the page.
- Set how many pageviews to capture.
- Pick the target page. Match types include simple, exact, starts with, ends with, contains and regex.
- Set it live.
Data appears once visitors arrive. You can switch between map types and device filters, and download a spreadsheet of clicks by HTML element.
What each map tells you
| Map | What it shows | Use it to |
|---|---|---|
| Click or tap | Where visitors click, with red as most clicked | See whether your main button gets attention |
| Scroll | The share of visitors reaching each point of the page | Find where people drop off |
| Move | Where desktop users pause their mouse | Guess where attention goes |
Hotjar also offers engagement zones and rage-click maps. Heatmaps are built from recorded sessions, not every visit. With only a few pageviews, a move map may look like a click map. Wait for more traffic before drawing conclusions.
Reading a click map
Start with your main call to action. Then look at the unplanned hot spots. Dead clicks, which land on non-interactive things like photos or bold text, suggest visitors expected a link there. A common rage-click threshold is the same element clicked five times within 500 milliseconds, which usually points to something broken.
If your call to action looks cold, check the scroll map. If visitors never reach it, the fix is placement. If they reach it and do not click, the fix is wording. Both fixes are quick on our platform: tell your assistant what to move or rewrite, or change the text directly in the visual browser editor. The change is live right away, and the heatmap starts collecting evidence on the new version.
For a deeper look at which numbers matter on a landing page, see our guide to tracking landing page conversions. If you also want an analytics tool beside Hotjar, our Google Analytics install options cover that setup.
Add the Hotjar feedback widget
The feedback widget is the small on-page button where visitors rate their experience and leave a comment. The setup path in Hotjar is Feedback, then New Feedback Widget:
- Choose the question type. The default is a five-point emoji rating.
- Add a follow-up question that asks visitors to explain their rating.
- Set colors, left or right position, and language.
- Target all pages or specific ones, and choose desktop, mobile or both.
- Activate it.
Visitors can also attach a screenshot that highlights the part of the page they mean. That makes comments like “this is confusing” much easier to act on.
Keep it simple. One rating question plus one open follow-up is the recommended shape. Put it on the pages where you need the most insight, such as pricing, checkout or service pages. Review responses weekly, group them into themes, and act on patterns rather than single comments.
A limit to plan around: in Contentsquare, the widget sits on the Voice of Customer side, where the free tier lists 100 responses and 5 interviews a month. Once the monthly response limit is hit, surveys and widgets stop showing until the reset.
If your goal is collecting leads rather than opinions, a form does the job better. Our lead capture form examples show field templates you can ask your assistant to build.
Privacy, masking and consent
Recording visitors means you handle personal data, so settle these points before launch.
- Mask sensitive fields. Hotjar can suppress elements such as password fields and credit card inputs, but you must configure this manually. Do not assume it is on for every field.
- Check where data lives. According to DevMixa, Hotjar stores data on AWS in Ireland (eu-west-1), and number sequences are suppressed by default.
- Confirm retention before you publish a privacy notice. Retention differs by plan. Ask Hotjar support which figure applies to your account and write that one in.
- Update your privacy policy. Tell visitors you use heatmaps and recordings. Your assistant can add that paragraph to your policy page.
- Wire up consent. If your audience includes regions with consent rules, make sure the banner controls the Hotjar script. This is a legal question for your own adviser, so involve one for your specific markets.
Check the speed impact
Hotjar adds a third-party script, and the effect depends on what else your page loads. Independent numbers show the range:
- A benchmark of 34,550 homepages found Hotjar took a median of 76 ms of main-thread time and 65 KB of transfer.
- A test of 50 Shopify stores measured an average of about 829 ms added to load time. That is a heavier theme environment than a lean page.
Measure it yourself. Run PageSpeed Insights on your key pages before installing, and again a week later. Compare INP and Total Blocking Time. If scores drop, load the script with Google Tag Manager’s Window Loaded trigger so it starts after the page finishes loading.
There is a trade-off. A tag fired through a tag manager starts slightly later than one hardcoded in the head, so very short sessions can go unrecorded. That trade-off is usually acceptable for heatmaps. Hardcode the snippet in the head if every session must be captured.
Our perspective
Most Hotjar problems are workflow problems, not tool problems. People install the script, wait a month, and then stare at a pile of recordings. The loop that works is short: pick one page, ask one question, change one thing, look again.
That loop is why we built WebsitePublisher as a full-stack AI web platform for websites and apps. Hosting, forms, email, payments, uploads and data are already built in, and your AI assistant snaps together building blocks from 140+ tested integrations instead of generating untested glue code. When a heatmap shows that visitors never reach your form, you describe the change to your assistant, and it is live immediately. There is no deploy step between the insight and the fix.
Tasks and task history stay with the project across sessions and assistants. So the note “we added Hotjar to the pricing page and moved the button” is still there when you switch from one AI to another, or hand a client project to a colleague. For freelancers and agencies running several sites, that continuity is the difference between a tidy audit trail and a guessing game.
Our advice: start with one page, one heatmap and one feedback question. Add more only when you have acted on what the first one told you.
Build, measure and fix on one platform
If you do not have a site yet, you can start with the AI web platform and add Hotjar once the first page is live. Describe the website or app you want to your AI assistant. It builds and publishes through the WebsitePublisher connector, on a full-stack backend that is already in place. You can adjust content and design afterward in the visual browser editor without regenerating anything.
See the AI website builder page for how it works, and our pricing page for plans, including a free one.

Want a page worth measuring first? Our guide to building a landing page with AI shows the prompt-and-edit flow.
FAQ
Where does the Hotjar tracking code go?
It goes in the <head> of every page you want tracked. Each site in Hotjar has its own unique snippet, so use the one that matches your domain. On our platform, you give the snippet to your AI assistant and name the pages.
How long until Hotjar shows data?
Verification usually takes a few minutes after your first visit. Recordings and heatmaps need real traffic and session capture switched on. If nothing appears, Hotjar’s guidance is to wait up to 12 hours before deeper troubleshooting.
Can I still sign up for Hotjar?
New Hotjar accounts can no longer be created, because Hotjar is now part of Contentsquare. New users sign up for Contentsquare, which carries over heatmaps, session recordings, surveys and interviews. Existing Hotjar accounts are being moved to Contentsquare, and the current tracking code keeps collecting data.
Does Hotjar work on apps as well as websites?
Yes, for web apps. The official @hotjar/browser package initializes with your site ID and includes a state-change call for single-page apps, so route changes are tracked without a full page reload.
Sources
- Hotjar Pricing Plans and Free Plan Limits (2026 Update), DevMixa
- Hotjar customers: your new Contentsquare account, Hotjar Help Center
- How to Set Up Heatmaps on Your Website with Hotjar, Supermonitoring
- hotjar/hotjar-js on GitHub
- Add Hotjar to Joomla, Tassos Code Snippets
- How to Install Hotjar on Shopify, UAATEAM
- Analyze User Behaviour, Greenpeace Planet4
- Hotjar Review 2026, EuropeanStack
- Hotjar Heatmaps: Five Types and One Sampling Rule, RevenueFlow
- Using heatmaps with Hotjar to fix weak pages, ProfileTree
- Hotjar Tutorial: Set Up Heatmaps and Session Recordings, Marketing Agency Singapore
- Hotjar Review 2025, Workflow Automation
- Hotjar Page Speed Impact, Perfdelta
- Hotjar Adds 829ms to Shopify: 50-Store Speed Test, Thunder Page Speed
- Hotjar for Small Business Websites: A Practical Guide, ProfileTree
Recommended
- TikTok Pixel Website Integration: Setup Guide for Sites and Apps
- How to Add Intercom to Your Website: Setup Guide
- Zapier Website Integration: How to Connect Your Site
- Google Analytics on AI Web Platforms: 3 Install Options, Verify First
Build your site the same way
Describe what you want. Your AI builds and publishes it — with the full stack behind it: data, auth, forms, payments, integrations and hosting.
See how it works →
Website