Cookies & tracking
Hotjar and cookie consent: what you need to do
In the EU and UK, Hotjar needs visitor consent before it sets cookies or records a session, because heatmaps and recordings are for your analytics, not something the visitor asked for. Load it only after the visitor accepts the analytics category, and test that nothing fires when they reject it.
- Plain English
- Written for website owners
- Free to read
On this page
Hotjar gives you heatmaps, session recordings and on-page feedback. To provide them, it places cookies on the visitor's device and records how people move, click and scroll. In the EU and UK, that storage and tracking needs consent unless it is strictly necessary for something the visitor asked for. Heatmaps and recordings serve your product decisions, not the visitor's request, so you should treat Hotjar as an analytics service that waits for a yes.
What Hotjar does on your site
Hotjar has three main parts that matter for consent. Heatmaps aggregate where visitors click, move and scroll. Session recordings replay individual visits so you can watch what happened. Feedback tools, such as polls and surveys, ask visitors questions on the page. Each part relies on the same basic mechanism: a script loads, sets identifiers that let Hotjar link pages in one visit or across visits, and sends events to Hotjar's servers.
The identifiers are what triggers the consent rule. Cookies and similar storage are covered by ePrivacy Directive Article 5(3), which requires consent before information is stored on or read from a device, unless an exemption applies. Recordings also process personal data under the GDPR, so you need a lawful basis for that processing as well. For Hotjar, consent covers both.
Why Hotjar is not strictly necessary
Strictly necessary cookies keep a service working for the visitor, such as a basket or a login. Hotjar does none of that. Your site works the same whether Hotjar runs or not. Regulators read the exemption narrowly, and a tool that records behavior for your own analysis is outside it. That is why most EU and UK guidance puts session tools in the analytics category, behind consent.
Some teams try to argue a privacy-friendly setup avoids consent. Masking inputs and sampling sessions reduce the data you collect, but they do not remove the storage on the device. If a cookie or device identifier is set, the rule still applies. Our guide on cookieless analytics explains where that argument holds and where it does not.
Find every Hotjar load on your site
Hotjar can reach your site in three ways, and you need to find all of them before you can block any of them. Check each one:
- A script in the page template. Look in your theme, page builder or CMS head settings for the Hotjar snippet.
- A tag manager. Check your Google Tag Manager container or similar for a Hotjar tag and its trigger. Our guide on Google Tag Manager consent covers how to gate tags.
- A plugin or app. Platform add-ons sometimes inject the script for you. Look at installed plugins and integrations, not only your own code.
A free cookie scan records the cookies and third-party hosts that load on your pages, so it shows Hotjar cookies and requests even when you have forgotten where the script lives. Run it on a page with recordings enabled, and again on any page type you have not checked, such as checkout or account pages.
Block Hotjar until the visitor agrees
The simplest pattern is to change the script type so the browser does not run it until your consent banner allows it. The PrivacyQuick script blocker does this for you when you mark the tag with a category. Here is the pattern in plain HTML:
<!-- paste your Hotjar snippet from your Hotjar account inside this tag -->
<script type="text/plain" data-category="analytics">
/* Hotjar snippet goes here */
</script>
Use the category that matches the purpose. Hotjar used for your own product analytics belongs in analytics. If the same data feeds advertising audiences, that use belongs in marketing, and your cookie policy should say so. Do not put Hotjar in the necessary category to avoid the banner. That misclassifies the tool and will not hold up if a regulator checks.
If Hotjar loads through Google Tag Manager, gate the tag on consent rather than on the script type. Map the analytics choice to the right Google Consent Mode signal, and add a consent check to the tag's trigger. The basic and advanced Consent Mode approaches differ in what is sent before a choice, so pick the one that matches your banner.
Hold Hotjar behind the analytics choice. If the visitor rejects analytics, no Hotjar cookie should be set and no recording should start.
How the rules differ by region
Where you hold Hotjar depends on where the visitor is, and PrivacyQuick picks the banner mode from the visitor's country. In the EU, EEA, UK and Switzerland, use opt-in: nothing non-essential runs before consent. In Canada and Brazil, the default is also opt-in. In the United States, the usual model is opt-out for sale or sharing, and PrivacyQuick honors the Global Privacy Control signal. Hotjar used only for your own analytics is a different question from a sale of personal data, so the US answer depends on how the data is shared and under what contract.
Check your own position in the United States. Whether a tool is a service provider or a third party depends on your contract and on how the vendor may use the data. Read the terms that apply to your account, and describe the use accurately in your privacy policy.
Session recordings and form data
Recordings can capture what visitors type, so review your masking and field settings before you turn them on. Typed data is the most sensitive part of a recording. Do not record checkout, login or health-related pages without a clear reason and a consent basis. Our guide on session replay and consent covers the wider questions, including how to explain recording in your policy.
Disclose Hotjar in your privacy policy as a service that processes visitor data, and name the purposes. Keep the processor terms, including any data processing agreement Hotjar makes available in your account, in your records. Keep them up to date as the vendor changes its terms.
Test your setup
Testing is what separates a working setup from a banner that looks right. Use this sequence each time you change the script, the tag or the banner:
- Open the site in a private window with no cookies stored.
- Click Reject all, or reject analytics, on the banner.
- Browse several pages, including the ones with recordings enabled.
- Check the cookies in your browser, then check the network tab for requests to Hotjar.
- Accept analytics on a second private window and confirm Hotjar starts only then.
Repeat the test after any change to the banner text, because a new banner version can ask visitors again. A scheduled scan with alerts for new trackers catches a script that a plugin or a developer adds later.
Keep a dated record of each test: the date, the banner version, the pages you checked and what you saw. If a customer or regulator asks how you handle analytics, a dated record shows the setup worked at a point in time. Your consent log shows how many visitors accepted analytics, which gives you a rough check that the banner is being used as intended. Compare those counts with the Hotjar sessions you see in your account. A large gap is a reason to re-test the flow.
Next steps
- Find every Hotjar load: template, tag manager, plugins and any app integrations.
- Classify Hotjar as analytics, and add marketing only if the data feeds advertising.
- Gate the script on the analytics choice, using a script type or a consent trigger.
- Review masking and recorded pages before you turn on recordings.
- Disclose Hotjar in your privacy policy and keep the processor terms on file.
- Test the rejected state in a private window, then run a scan to confirm.
Hotjar's features and vendor terms change, so check the current list of cookies and the terms in your account before you rely on any named cookie. Our script blocking documentation covers the category syntax in full.
Frequently asked questions
Does Hotjar need cookie consent?
In the EU, UK and similar regimes, yes. Hotjar stores identifiers on the visitor's device and records how they use the page. That is not strictly necessary for a service the visitor asked for, so it needs consent before it runs.
Which cookie category should Hotjar use?
Analytics is the usual choice, because heatmaps and recordings measure how people use your site. If you also use the data to target advertising, classify that use as marketing and describe it in your cookie policy.
Can I load Hotjar before the visitor chooses?
Not in opt-in regions. Hold the script behind the consent choice, so no Hotjar cookie is set and no recording starts until the visitor accepts analytics.
How do I check that Hotjar is blocked when someone says no?
Open your site in a private window, reject all, and look at the cookies and network requests. No Hotjar cookie should appear and no request should go to Hotjar's servers. A cookie scan shows the same thing across all pages.
Check your own website in 30 seconds
Our free scanner lists every cookie and tracker your site sets, sorted into categories, before you add a banner.
This guide is general information, not legal advice. Laws and regulator guidance change; check the current rules for your situation or ask a lawyer.