You'll need to have installed GTM on your live website to use this article. See Google's Tag Manager overview guide to learn how to install GTM.
Server-side tagging is not supported
A client-side tagging configuration is required to load the Hotjar tracking code with Google Tag Manager. You can learn more in Google's guide.
- How to install Hotjar's tracking code on your site with GTM
- How to send Events to Hotjar with GTM
- How to send User Attributes to Hotjar with GTM
How to install Hotjar's tracking code on your site with GTM
Installing the Hotjar tracking code on your site is the first step to using Hotjar's tools and features. After setting up GTM on your site, a GTM container will be present. When you create new Hotjar site, Hotjar detects this GTM container, and you can install the Hotjar tracking code by selecting the recommended Hotjar + GTM installation integration option during the installation process. To help you install the Hotjar tracking code using the integration, see our Hotjar + GTM installation integration guide.
We have created a troubleshooting guide addressing the most common issues people face when installing Hotjar on their site via GTM.
How to send Events to Hotjar with GTM
Hotjar Events provide a way to filter your collected data or trigger Hotjar tools based on actions or changes that happen on your site. See our article What are Events to get an overview of what events are and how they work.
With GTM installed on your site, it's possible to send actions or changes on your site as events to Hotjar using GTM. Events can be set up within GTM itself, saving you from needing to add further custom code directly to your live website. To get started with sending events to Hotjar using GTM, see our How to Send Events with Google Tag Manager article.
How to send User Attributes to Hotjar with GTM
User Attributes enable you to send existing data about your users to Hotjar for use in Hotjar's tools. You can filter collected Recording and Heatmap data by User Attributes, create Segments or show Surveys and Feedback widgets only to specific users. See our What Are User Attributes article for more details on User Attributes.
One way of sending your user data to Hotjar as User Attributes is with an existing GTM installation if it is already present on your site. Follow our guide on How to Send User Attributes with Google Tag Manager to learn how you can set this up and enhance your filtering and targeting options inside Hotjar.