This article provides instructions on how to install Hotjar on your Squarespace site and also offers a workaround for tracking Squarespace checkout conversions.
How to install Hotjar on your Squarespace site
Adding custom JavaScript is only available for Premium Squarespace plans
To see if you are on Squarespace premium plan, head to their support document Premium Squarespace plans.
Go to hotjar.com to copy the tracking code from the Hotjar admin.
Click on Website Tools in your Squarespace dashboard.
Navigate to Code Injection.
Paste the Hotjar tracking code in the Header section text area.
Don't forget to click Save before closing the window.
Your Hotjar tracking code is now installed
Once you have added the Hotjar tracking code to your site, you will need to wait a few minutes for Hotjar to check if it is installed correctly. This usually happens the moment your site is loaded with the Hotjar tracking code on it - you can visit the page yourself to speed the process up. Once Hotjar has detected the tracking code on your site, the Site Dashboard will show a notice like the one below:
Keep your Hotjar tracking code in mind when making design changes on your site
If your website undergoes a major design change after you've installed the tracking code, check to ensure your tracking code is still installed.
How to record the Squarespace checkout flow
Unfortunately, Squarespace does not offer the ability to add third-party scripts to their checkout pages. However, below are some possible workarounds for tracking conversions in Hotjar:
-
Track the confirmation page
While you can't track the checkout flow in Squarespace, you can track your confirmation page. This means you can see sessions from users who made a purchase by filtering Recordings based on the confirmation page URL for your site (e.g. they visited the page that contains /order-confirmed).
Note: We recommend that you double-check the confirmation page URL on your live website, to ensure that your filter criteria matches your site's confirmation page URL. If it doesn't, you may need to filter by something other than "/order-confirmed" to see the desired sessions. -
Add event triggers
If you're interested in comparing users who made a purchase versus those who began the checkout process, but didn't finish it, you can explore adding Event triggers to the buttons on your site that would take users to the checkout page. Then filter the Recordings based on your events, to compare the following segments of users:
- Users that clicked the buttons and reached the order confirmation page.
- Users that clicked the buttons and did not reach the order confirmation page.