H Hotjar

How to add tracking code to Squarespace on Hotjar

beginner 8 min read Updated 2026-03-18
Quick Answer

Adding Hotjar tracking to Squarespace involves copying your unique tracking code from Hotjar's dashboard and pasting it into your Squarespace site's header code injection area. This enables heat mapping, session recordings, and user feedback collection on your website.

Prerequisites

  • Active Hotjar account
  • Admin access to Squarespace website
  • Basic understanding of website analytics
  • Website already published on Squarespace

Step-by-Step Instructions

1

Log into your Hotjar account

Navigate to hotjar.com and sign in to your account. If you don't have a site set up yet, click Add Site and enter your Squarespace website URL to create a new site configuration.
Make sure to use your full website URL including https:// when adding your site
2

Copy your Hotjar tracking code

In your Hotjar dashboard, select your site from the dropdown menu. Go to Settings > Sites & Organizations > Tracking Code. Copy the entire JavaScript tracking code that starts with <script> and ends with </script>.
The tracking code is unique to your site - never share it publicly or use another site's code
3

Access Squarespace Settings

Log into your Squarespace account and navigate to your website dashboard. Click Settings in the left sidebar menu, then select Advanced from the settings options.
4

Open Code Injection settings

In the Advanced settings section, click on Code Injection. This will open the code injection panel where you can add custom code to different parts of your website.
Code injection is only available on paid Squarespace plans, not on trial accounts
5

Add the tracking code to Header

In the Header section of Code Injection, paste your Hotjar tracking code. Make sure the entire code block is pasted correctly, including the opening <script> and closing </script> tags.
Always paste tracking codes in the Header section to ensure they load on every page before other content
6

Save and publish changes

Click Save at the top of the Code Injection page. The changes will be automatically applied to your live website. Return to your main site dashboard to confirm the changes are saved.
Changes to code injection are applied immediately - no need to republish pages individually
7

Verify tracking is working

Return to your Hotjar dashboard and wait 5-10 minutes. Visit your Squarespace website in a new browser tab to generate some activity. Check the Verify Installation section in Hotjar to confirm the tracking code is receiving data properly.
Use an incognito/private browser window when testing to avoid any browser extensions interfering with tracking

Common Issues & Troubleshooting

Hotjar shows 'No data received' after installation

Wait up to 30 minutes for data to appear. Clear your browser cache and visit your site again. Verify the tracking code was pasted correctly in the Header section, not Footer.

Code Injection option not available in Squarespace

Code Injection requires a paid Squarespace plan. Upgrade from trial or personal plan to Business plan or higher to access this feature.

Tracking code appears as text on website

The code was likely pasted in a content area instead of Code Injection. Remove any visible code from page content and ensure it's only in Settings > Advanced > Code Injection > Header.

Hotjar features not working on all pages

Ensure the tracking code is in the Header section of Code Injection, not in individual page headers. Header code injection applies site-wide automatically to all pages and templates.

Prices mentioned in this guide are pulled from current plan data and may change. Always verify on the official Hotjar website before purchasing.