Table of Contents
Hotjar is a powerful tool that helps website owners understand user behavior through heatmaps, session recordings, and feedback polls. Installing Hotjar on your website is straightforward and can provide valuable insights to improve user experience and increase conversions. This tutorial walks you through the practical steps to set up Hotjar on your website.
Step 1: Create a Hotjar Account
Visit the Hotjar website at https://www.hotjar.com. Click on the "Sign Up" button and fill out the registration form with your details. Once registered, log into your Hotjar dashboard to start the setup process.
Step 2: Add a New Site to Hotjar
After logging in, click on "Add a New Site" or "Add a Tracking Code" within your dashboard. Enter your website’s URL and give your site a name for easy identification. Hotjar will then generate a unique tracking code specific to your site.
Step 3: Copy the Hotjar Tracking Code
In your Hotjar dashboard, locate the tracking code snippet. It will look similar to this:
<script> (function(h,o,t,j,a,r){h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};h._hjSettings={hjid:YOUR_ID,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>
Step 4: Insert the Tracking Code into Your Website
There are multiple ways to add the code to your website:
- Using a WordPress Plugin: Install a header and footer plugin like "Insert Headers and Footers" or "Header, Footer & Blocks." Paste the code into the header section.
- Editing Theme Files: Access your theme’s
header.phpfile via the WordPress Theme Editor or FTP. Paste the code just before the closing</head>tag. - Using a Page Builder: If your website uses a page builder with header scripts, insert the code in the custom scripts section.
Step 5: Verify the Installation
After adding the code, go back to your Hotjar dashboard and click on "Verify Installation." Hotjar will check if the tracking code is active on your website. It may take a few minutes for data to start appearing.
Additional Tips for a Successful Setup
Ensure that your website’s privacy settings and cookie policies comply with applicable laws such as GDPR. Inform your visitors about the use of Hotjar and obtain necessary consents if required.
Regularly check your Hotjar dashboard to analyze heatmaps, recordings, and feedback. Use these insights to optimize your website’s design and user experience.