Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Hotjar script missing or wrong site ID: how to find and fix it

TRK-238Low impactCould addBy FunnelGuardPublished Updated
On this page

What this issue is

Hotjar is a tool that shows heatmaps (where people click and scroll) and session recordings (replays of visits). It works through a small script on your pages. The script contains a site ID, set as hjid, which tells Hotjar which of your sites the data belongs to.

This issue means one of three things: the script is not on the page at all, it is on some pages but not others, or it is there with an ID that belongs to a different site (an old staging site, a client's project, or a typo).

Why it costs you leads or sales

Hotjar does not bring in leads by itself, so the direct impact is low. The cost is indirect: you make design and copy decisions without the evidence you think you have. A form that confuses people, or a button that is hard to tap on mobile, stays hidden because the recordings are empty.

A wrong ID is worse than a missing script. Data can flow into another project, so you may read the wrong site's heatmaps, or an agency may mix up two clients.

Where the data gets lost
  1. Visitor landsPage loads normally
  2. Hotjar scriptMissing or wrong hjid
  3. RecordingNever starts
  4. HeatmapStays empty

A missing or wrong site ID breaks the chain at the first step.

How to check if your site has it

Check the Hotjar install
  1. Find your real site ID

    In Hotjar, open the Sites & Organizations list (or Settings, then Sites). Note the numeric Site ID of the site you want to track.

  2. View the page source

    Open your page, right-click, choose View Page Source, and search for hotjar or hjid. Compare the number with your Site ID.

  3. Check in the browser console

    Open DevTools, go to Console, and type typeof hj. If it returns function, the script loaded. Type window._hjSettings to see the hjid in use.

  4. Check the Network tab

    Reload with the Network tab open and filter for hotjar. You should see a request to static.hotjar.com for a file containing your ID, and no blocked or failed requests.

  5. Test key pages

    Repeat on the homepage, a landing page, the form page, the checkout and the thank-you page. Scripts are often missing on pages that use a different template.

  6. Use Hotjar's own check

    In Hotjar, open the site's installation settings and use the Verify installation option, then load your site in another tab.

How to fix it

Copy the snippet from Hotjar (Sites, then your site, then installation instructions) so the ID is correct. The standard tracking code looks like this, with your own number in place of 1234567:

Hotjar tracking code (replace 1234567 and check the version)html
<script>
    (function(h,o,t,j,a,r){
        h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
        h._hjSettings={hjid:1234567,hjsv:6};
        a=o.getElementsByTagName('head')[0];
        r=o.createElement('script');r.async=1;
        r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
        a.appendChild(r);
    })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
</script>
Fix by platform
  1. Find where it is installed

    Check your Hotjar plugin settings, any header and footer scripts plugin, and your theme's header options. Look for more than one place holding an old ID.

  2. Correct or paste the ID

    Replace the ID or paste the snippet into the head section once. Remove duplicates.

  3. Clear caches

    Purge your caching plugin and CDN so visitors get the updated page.

How to confirm it's fixed

Confirmation checks
  • typeof hj returns function in the console on each key page
  • window._hjSettings.hjid matches your Site ID in Hotjar
  • The Network tab shows static.hotjar.com loading with no errors
  • Hotjar's Verify installation reports the site as connected
  • A test visit appears in Recordings after a few minutes (allow for your plan's sampling and limits)
  • Only one Hotjar script loads per page

How to prevent it happening again

Prevention habits
  • Keep one documented install method and one owner for it
  • Record the correct Site ID for each client or environment
  • Re-check after theme changes, redesigns, migrations and GTM publishes
  • Use separate Hotjar sites for staging and production
  • Look at Hotjar's recent recordings weekly; a gap is the first sign of trouble

How FunnelGuard handles this

FunnelGuard does not check for this yet. A Hotjar script check is a possible future addition, but today it is not built, so FunnelGuard will not tell you if the Hotjar ID is wrong.

To watch for a Hotjar problem, use a manual routine: check the Recordings list in Hotjar weekly, use Hotjar's Verify installation after site changes, and add a Hotjar check to your launch checklist. A free FunnelGuard plan covers 1 site and 2 journeys with daily checks, no card needed.

Hotjar install

Broken

  • No script on some templates
  • Old or staging ID in the code
  • Empty heatmaps and no recordings

Fixed

  • One snippet with the correct ID on every page
  • Verify installation passes
  • Recordings appear within minutes

Questions people ask

Why is Hotjar not recording my website?

The usual causes are a missing script, a wrong site ID, a cookie banner or ad blocker stopping it, or a plan limit on sessions. Check the page source for hjid, compare it with your Site ID in Hotjar, and test in a clean browser.

How do I find my Hotjar site ID?

Open Hotjar and go to the Sites list or Settings, then Sites. Each site shows a numeric Site ID. The same number appears as hjid in the tracking code.

How do I check if Hotjar is installed correctly?

Use Hotjar's Verify installation option while your site is open in another tab. You can also type typeof hj in the browser console, which should return function, and check that window._hjSettings.hjid matches your ID.

Can Hotjar work with the wrong site ID?

The script will load, but data goes to whichever Hotjar site owns that ID, so your own project stays empty. This often happens after copying code from a staging or another client's site.

Why does Hotjar show no data in Google Tag Manager?

Check that the tag has the right Site ID, that its trigger fires on the pages you expect, and that no consent setting blocks it. Use Preview mode, then publish the container, as unpublished changes do not go live.

Does FunnelGuard check if Hotjar is installed?

No. A Hotjar check is a possible future feature, but it is not built yet. FunnelGuard does monitor your funnels, tracking hits to ad and analytics platforms, and test lead delivery.

How long until Hotjar recordings show up after fixing the script?

Usually within a few minutes of a test visit, though it depends on your plan's sampling and limits. If nothing appears after a while, re-check the ID and that only one script loads.

Does FunnelGuard catch this?

Could add

Not checked yet: could be added to FunnelGuard.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.