Learn / Guides / Website tracking guide

Back to guides

How to track user activity on your website

User activity tracking is the process of monitoring, collecting, and analyzing visitor browsing behavior on a website or app.

The easiest and most popular way to start tracking website users is to set up Google Analytics (we'll show you how below). But Google Analytics (GA) can be equal parts overwhelming and limited: it’s packed with options but will only show you what happens on your site, not why.

Read on to learn how you can track user activity on your website with visually engaging behavior analytics tools like heatmaps and session recordings to understand what’s happening, fix functionality issues, and spot those all-important optimization opportunities.

Last updated

20 Nov 2023

Reading time

7 min

Share

2 easy ways to track user activity on your site

💭 Understand your users with Hotjar

Use Hotjar to safely track user behavior and understand how people experience and interact with your website or app.

Businesses and website owners use a number of tracking software tools to view how users behave on their website. Some of the most common ways to monitor user activity include:

We’ll go over these tracking methods in detail below and show you how to use them effectively.

How to track users with Google Analytics

<#GA4 dashboard
GA4 dashboard

Google Analytics (GA) is the most popular traditional web analytics tool, used by 74% of web analysis professionals. If you already work with GA, you can skip to the next section. If not, here’s a quick overview of the set-up process:

1. Create and configure your Google Analytics account

<#Google Analytics is free and easy to set up
Google Analytics is free and easy to set up

In 2020, Google launched a new version of Google Analytics called GA4 (this version replaced the older Universal Analytics version in July 2023).

Here’s how to set up GA4.

And here’s how to switch from Universal Analytics to GA4.

2. Add GA tracking code to your pages

<#GA4 tracking code
GA4 tracking code

Paste the global site tag into the <head> section of every page, or add it with Google Tag Manager.

3. View reports

<#Realtime website traffic overview in GA4
Realtime website traffic overview in GA4

Google Analytics will generate reports as soon as you get some traffic to your site.

Start with the Realtime report (Reporting > Realtime) to view live website traffic data and verify that GA is set up correctly.

The problem(s) with GA

GA lets you track many useful quantitative metrics, like ecommerce transactions, custom events, and conversions, but there are two main issues:

1) There’s so much data it can be overwhelming: getting started with GA is fairly straightforward, but becoming an expert can be a full-time job (literally).

<#Google Analytics: it’s a full-time job
Google Analytics: it’s a full-time job

There are so many features and options, and GA4 produces radically different reports to the ones we’ve been used to for the past 5–10 years. Our survey of analytics professionals revealed that 1 in 5 people found tracking tools like Google Analytics to be overwhelming (and that was before GA4).

2) GA doesn’t tell you why users behave as they do: for example, you might learn that a landing page has low engagement from GA data, but you can only guess what’s causing it. That’s why you need to pair GA with user behavior analytics to complete the picture and find out how users really experience your site.

How to track user activity with behavior analytics

Behavior analytics is the process of tracking and analyzing quantitative and qualitative user data to identify how people interact with your website or product, and why.

Behavior analytics tools give context to the insights you get from GA by allowing you to track user behavior on the page directly. Using them together gives you a clearer understanding of how users experience a page so you can fix issues, optimize UX, and improve conversion rates.

Setting up a SaaS behavior analytics tool is just like GA: sign up, add a tracking code, and view reports. Here’s how to get started with the two most popular behavior analytics tools: heatmaps and session recordings.

Track where users click, move, and scroll with heatmaps

<#A Hotjar scroll map (left) and click map (right)
A Hotjar scroll map (left) and click map (right)

The easiest way to track and visualize where users click, move, and scroll is to use heatmaps.

Website heatmaps are visual representations of the most popular (red) and unpopular (blue) elements on a page, giving you an at-a-glance understanding of what people look at and ignore, which helps you identify patterns and optimize for increased engagement.

<

Heatmaps reveal if users actually click on your calls-to-action

There are three main types of heatmap:

  • Scroll heatmaps show how far down the page users scroll, and the average fold position

  • Click heatmaps show where website visitors click (and tap on mobile)

  • Move heatmaps show how users move their mouse as they browse

Other heatmaps go beyond just the basics: Hotjar rage click maps, for example, track repeat clicks and help you visualize points of user friction on a page. They’re a great tool to track functionality issues because they quickly expose non-clickable or broken elements that frustrate users.

#Hotjar rage click maps reveal user frustration
Hotjar rage click maps reveal user frustration

When you’re ready to start tracking, here’s how to set up a free heatmap on a website or single-page application (SPA) in just a few minutes:

1. Sign up for Hotjar

Hotjar (hi 👋) is an easy-to-use behavior analytics software used on over 1 million websites worldwide. Our free heatmap tool, Heatmaps, requires virtually no setup and will give you immediate insights from the moment you install your tracking code.

<#Signing up for Hotjar takes only a few clicks
Signing up for Hotjar takes only a few clicks

Sign up for Hotjar with your Google account or email address. There’s a free forever basic plan to get you started.

2. Add the Hotjar tracking code to your website

<#Simply copy and paste your Hotjar tracking code or install it directly on a platform
Simply copy and paste your Hotjar tracking code or install it directly on a platform

You can add the Hotjar tracking code via Google Tag Manager by pasting the JavaScript snippet into the <head> of every page you want to track, or by using the official Hotjar plugin on your WordPress site or online platform.

3. Create a new heatmap

Once you’re in the Hotjar dashboard, select “Heatmaps” from the left column, then click the “New heatmap” button.

Enter the URL of the page you want to track, then select the type of heatmap you want to set up.

<

Your selection will take you back to the Hotjar dashboard where you can edit the heatmap. Don’t forget to name it something descriptive (e.g. “product landing page”).

We put Hotjar on all our pages. If our conversion rate drops after a change, our Heatmaps help us identify and solve the issue. Hotjar has helped define our website strategy and make the experience even better for our customers.

Anna Grünanger
Head of Customer Acquisition at Vimcar

And that’s it: you can view your new Hotjar heatmap from the first recorded pageview (the free plan will sample data from 35 user sessions per day).

It will look something like this:

<#You can view heatmaps by device (desktop, tablet, or mobile) and heatmap type (click/tap, scroll, move, rage click, and Engagement Zone).
You can view heatmaps by device (desktop, tablet, or mobile) and heatmap type (click/tap, scroll, move, rage click, and Engagement Zone).

If you want to get more insight from your heatmaps, here’s our detailed guide to creating a heatmap (including the best pages to collect data on), and how to analyze your heatmap once the data’s flowing in.

💡Pro tip: streamline your heatmap analysis by viewing the Engagement Zones map in Hotjar. This heatmap combines data from click, move, and scroll maps into one visualization that shows which elements users interact with the most. 

Tracking this behavior helps you understand what your users find most valuable, so you can figure out if any elements need rearranging on the page to improve the customer experience and boost conversions.

The Hotjar Engagement Zone heatmap visualizes user interaction with darker box areas

Tracking in action with heatmaps

#A landing page heatmap showing clicks before and after a redesign
A landing page heatmap showing clicks before and after a redesign

UX designers at Bannersnack, a graphic design platform, used Hotjar Heatmaps to track how people interact with key landing pages. Based on heatmap data, the team created an alternative design to A/B test against the old one. The new iteration led to an impressive 25% increase in sign-ups.

Hotjar has become an important part of our conversion optimization process, helping us understand our customer better and, ultimately, sell more. We strongly recommend it!

Gery Meleg
VP of UX at Bannersnack

💡Pro tip: if you’re in the game of digital marketing and conversion rate optimization (CRO), then you’ll know that user tracking tools like GA will only show you conversion metrics like exit and bounce rates without explaining why. Hotjar Funnels, on the other hand, give you the data and provide an explanation—all without you having to switch between multiple platforms. 

Investigate ongoing drop-offs or see how a new landing page performs after launch by diving deep into funnel analysis with Hotjar’s behavior analytics tools. Notice a lot of rage clicks on a landing page’s heatmap? Tab over to Funnels in the Hotjar dashboard to see if it’s affecting your conversion funnel.

💭 Understand your users with Hotjar

Use Hotjar to safely track user behavior and understand how people experience and interact with your website or app.

See how users behave with session recordings

#An example Hotjar session recording showing user behavior during a session
An example Hotjar session recording showing user behavior during a session

Heatmaps are great for showing you the overall user experience on any single page, but you’ll get richer qualitative insight by looking at how individual users experience your site across several pages. And for that, you’ll need session recordings.

Session recordings (also known as session replays) are renderings of real user actions as they browse a website. Recordings show mouse movement, clicks, taps, and scrolling across multiple web pages on desktop and mobile.

<#Session recordings provide valuable user tracking data
Session recordings provide valuable user tracking data

Here’s how to view session recordings on your site with the Hotjar Recordings tool in a couple of steps. If you’re not already a Hotjar customer, sign up now (free forever pricing plan available) and add the tracking code to your site.

Privacy-first tracking: Hotjar is designed to help you understand user behavior, not collect sensitive data. That’s why our session recordings are GDPR-compliant, don’t collect unnecessary information like IP addresses, and suppress all keystroke data (i.e. anything a user types in) by default. Read more about our privacy policy and how recordings work.

1. Activate Recordings on your site

<

After verifying that session capture is enabled by clicking on the traffic coverage widget in the top-right corner of the dashboard, select “Recordings” in the left column. 

Once Hotjar detects traffic on your site, new recordings will appear automatically on your Recordings List page (the free plan will give you recordings from a sample of 35 user sessions per day).

2. Start filtering

After one easy step, you're now tracking user session activity. Next, try playing around with the filter feature to narrow down the list of recordings to the ones most valuable to your user activity tracking goal.

#Hotjar session recording filters
Hotjar session recording filters

You can filter by criteria like geographic region, separate returning users from new users, or even single out rage clicks you spotted on a heatmap. 

💡Pro tip: if you’re using Optimizely for A/B testing, you can automatically filter Hotjar Recordings by Experiment ID with our Optimizely integration. (This is just one of many integrations that lets you use Hotjar with your favorite web apps).

Set Optimizely X experiments as events to filter Hotjar insights with the click of a button

In the Hotjar Recordings dashboard, go to Add Filter > Google Optimize and paste/select the relevant Experiment ID.

3. Review your Recordings

<

The final and most important step is to watch and analyze your session recordings (popcorn optional, but highly recommended 🍿).

We’ve written a detailed guide to user recording analysis that will help you save time and get maximum insight from your recordings.

💡Pro tip: one aspect worth highlighting here is Hotjar’s zoom in and out feature, which allows you to toggle effortlessly between the big picture insights from heatmaps and the granular detail that individual session recordings offer. 

For example, if you spot a user clicking on something unexpected during a recording, zoom out to that page’s heatmap to see how common the behavior is and determine if you need to switch up the page design—or do it all in reverse by zooming in to a recording from a heatmap.

Hotjar lets you zoom in from heatmap to recording and out from recording to heatmap

Tracking in action with session recordings

#The Razorpay product team using Hotjar
The Razorpay product team using Hotjar

The product design team at Razorpay, an online payment gateway, used session recordings to optimize a newly launched product: WYSIWYG payment pages. By watching how real visitors interacted with the live product, the team was able to optimize its design to improve UX.

Session Recordings helped us understand so many different ways that people used the product. We also identified the points on the page where we could further optimize the design.

Saurabh Soni
Product Designer at Razorpay

Take it further: combine tracking data with user feedback

Once you spot interesting or unusual user behavior in heatmaps and session recordings, ask your visitors and customers for direct feedback to learn more about why they behave the way they do (for example, why they're about to leave your site).

Just one on-site survey can give you valuable insight and lead to UX improvements and business growth: a single-question survey helped HubSpot Academy boost sign-ups by 10%.

<#The open-ended Hotjar survey HubSpot Academy posed to its users
The open-ended Hotjar survey HubSpot Academy posed to its users

If you’re using Hotjar, you can set up our Surveys tool to get instant user feedback on your website. Take a look at these survey templates and practical examples to see how real companies use surveys to collect feedback, as well as this list of survey questions to help you figure out the best questions to ask your users.

I hadn’t used Hotjar Surveys in the past, but I thought it was worth a shot. I quickly set up a Hotjar on-site survey that same morning. I was surprised to find that by the end of the first day, I was already getting some of the answers I’d been digging for.

Eric Peters
Product Lead at HubSpot

💡Pro tip: if you don’t have the time to devote to both user activity tracking and in-depth user feedback research, try Hotjar AI for Surveys. In mere seconds, you can create a survey for any user activity tracking goal, then automatically generate a summary report that includes a suggested action plan. 

💭 Understand your users with Hotjar

Use Hotjar to safely track user behavior and understand how people experience and interact with your website or app.

FAQs