How to set up Hotjar tracking on Shopify
Setting up Hotjar tracking on Shopify involves copying your Hotjar tracking code from your site settings and installing it via Shopify's theme editor or a tracking app. The process typically takes 10-15 minutes and starts collecting visitor data immediately after implementation.
Prerequisites
- Active Hotjar account
- Shopify store with admin access
- Basic understanding of website analytics
Step-by-Step Instructions
Access your Hotjar tracking code
<script> and includes your unique Site ID.Open Shopify theme editor
Locate the theme.liquid file
Insert the Hotjar tracking code
</head> tag in the theme.liquid file. Paste your Hotjar tracking code just before this closing head tag. The code should be placed after any existing scripts but before </head>.Save and verify installation
Configure tracking settings
Test heatmaps and recordings
Common Issues & Troubleshooting
Hotjar tracking code not detected after installation
Check that the code is placed correctly before the </head> tag and that there are no syntax errors. Clear your browser cache and wait up to 10 minutes for detection. Verify your Site ID matches the one in your Hotjar dashboard.
Heatmaps showing no data
Ensure your site has sufficient traffic (at least 30 page views) and that the heatmap page targeting rules match your Shopify URLs exactly. Check that JavaScript is enabled and not blocked by ad blockers during testing.
Recordings not capturing visitor sessions
Verify that session recordings are enabled in your Privacy Settings and that visitors aren't opting out via Do Not Track settings. Check if your site has cookie consent requirements that might be blocking tracking.
Tracking code conflicts with other apps
If using other analytics tools, ensure there are no JavaScript conflicts by testing page load speeds. Consider using Shopify's Google & YouTube app or similar tracking apps that handle multiple scripts more efficiently.