Find your Tracking Code within your Hotjar Overview.
Each site you add to your Hotjar account will have its own unique Tracking Code to install. You can find your Tracking Code to install by going to Sites & Organizations and clicking on the Tracking Code button next to the site URL.
Paste the Hotjar Tracking Code inside a Smarty template (.tpl file).
The specific template will vary depending on your Smarty project's setup. The template file should be one that will be applied across your whole site, such as the header.tpl.
Add {literal} tags within the Tracking Code's <script> tags.
Rather than inside script tags, the Tracking Code should be placed inside {literal}{/literal} tags:
<script type="text/javascript">
{literal}
(function(h,o,t,j,a,r){
/* ... rest of hotjar tracking code ... */
})(window,document,'//static.hotjar.com/c/hotjar-','.js?sv=');
{/literal}
</script>
The Hotjar Tracking Code must have {literal} tags placed around the script
Without the literal tags, your website will only render a blank white page.
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 Tracking Code in mind when making design changes
If after you install the Tracking Code, your website undergoes a major design change check to ensure your Tracking Code is still installed.