This article steps through how to install your Hotjar tracking code on your Shopify storefront.
How to install Hotjar on your Shopify site
Hotjar won't work in Shopify sandbox environments
If the Hotjar tracking code is installed in a Shopify sandbox environment, no data will be collected and Ask tools won't display.
This also prevent any tracking of the checkout pages and is due to Shopify's security measures around what data is made available within the sandbox.
To learn more, visit Shopify's Help Center article: Sandbox Pixel Limitations
Go to your Hotjar Sites page and click on Install tracking code for your site.
Click on Add code manually.
Click on Copy to copy the Tracking Code to your clipboard.
Visit your Shopify Admin dashboard.
Click on Online Store, then click on Themes.
On your current theme, click the more options button (⋯), then select Edit code.
Within the Layout folder, click on theme.liquid.
Scroll down the theme.liquid page until you've found the </head> closing tag.
Some themes will use a variation of the <head> </head> tags such as {/head}, [/header], or other variations of [/head]. These all work in the same way.
Paste your Hotjar Tracking Code just before the closing </head> tag.
Click Save to apply the changes.
This will install the Hotjar tracking code on your Shopify storefront only. Shopify’s built-in checkout process doesn't support the direct integration of third-party scripts, including the Hotjar tracking code.
Having trouble installing the Hotjar Tracking Code?
Visit our articles on How to Check That Hotjar Is Working and Troubleshooting FAQS for Tracking Code Installation for troubleshooting guidance.