---
title: "Add Hotjar to Joomla - Code Snippets"
description: "Your analytics show you how many visitors reach a page, but not what they do once they're there. You can't see where they click, how far they scroll,"
url: "https://www.tassos.gr/docs/code-snippets/howto/analytics-tracking/hotjar"
date: "2026-08-24T01:02:05+00:00"
language: "en-GB"
---

[ Home ](https://www.tassos.gr/index.php?option=com_content&view=category&layout=blog&id=24&Itemid=1088) / [ Code Snippets ](https://www.tassos.gr/index.php?option=com_content&view=category&id=120) / [ How-to Guides ](https://www.tassos.gr/index.php?option=com_content&view=category&id=125) / [ Analytics &amp; Tracking ](https://www.tassos.gr/index.php?option=com_content&view=category&id=140)

#  Add Hotjar to Joomla

Your analytics show you how many visitors reach a page, but not what they do once they're there. You can't see where they click, how far they scroll, or what they were looking for when they gave up. Hotjar answers those questions with heatmaps, session recordings, and on-page surveys, but its official Joomla instructions tell you to paste the tracking code into your template's files, an edit the next template update quietly wipes out. There is a safer way: you can add Hotjar to your Joomla site using Code Snippets.

## [What is Hotjar](#what-is-hotjar)

Hotjar is a behaviour analytics tool. It builds click and scroll heatmaps, records real user sessions, and lets you ask visitors questions through on-page surveys and feedback widgets, so you can see and hear why people behave the way your analytics numbers describe.

## [How to get the Hotjar Tracking Code](#how-to-get-the-hotjar-tracking-code)

You need a Hotjar account with a site added to it.

1. Go to [Hotjar](https://www.hotjar.com/) and sign in.
2. Open your **Sites** page from the settings menu.
3. Click **Install tracking code** next to the site you want to track.
4. Click **Copy** to copy the tracking code. Your **Site ID** is the number shown in the `hjid` setting of the snippet.

## [How to Add Hotjar to Joomla](#how-to-add-hotjar-to-joomla)

1. Install **Code Snippets** if it is not installed already.
2. Go to Joomla Administrator.
3. Open **Components → Code Snippets**.
4. Click **New**.
5. Give your snippet a descriptive title like "Hotjar Tracking Code".
6. Select **HTML** snippet type.
7. Paste the tracking code you copied from Hotjar. It looks like the following, with your Site ID in place of `YOUR_SITE_ID`

     ```
    <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_SITE_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>
    ```
8. Select **Site Header** as the "Insertion Method". Hotjar requires the tracking code inside the **&lt;head&gt;** tag, which is exactly where this places it.
9. Publish the snippet.
10. Optionally, open the **Conditional Logic** tab to restrict which pages the snippet runs on. Leave it empty to run it site-wide. Learn more in [Using Conditional Logic](https://www.tassos.gr/docs/code-snippets/functionality/conditional-logic).

Congrats! You've successfully added Hotjar to your Joomla site without installing another plugin or touching your template's files.

## [Verify it Works](#verify-it-works)

Open your website in a normal browser tab, then return to your **Sites** page in Hotjar. The site status changes to **Collecting data** once Hotjar detects the tracking code, usually within a few minutes of the first page load. Your visit then appears under **Recordings**. If the status doesn't change, confirm the snippet is published, that the Site ID matches the one in your dashboard, and that no ad blocker is running in your test browser. For more checks, see Hotjar's [How to Check That Hotjar Is Working](https://help.hotjar.com/hc/en-us/articles/36819989669905-How-to-Check-That-Hotjar-Is-Working) guide.

For more information about snippet types and insertion methods, visit our documentation: <https://www.tassos.gr/docs/tassos-code-snippets/>

 Last updated on Aug 19th 2026 14:08
