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 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.
That’s why the bulk of this guide will focus on showing you how to go beyond Google Analytics and track user activity with behavior analytics tools like heatmaps and session recordings to understand what’s happening, fix issues, and spot those all-important optimization opportunities.
How to track users with Google Analytics
1. Create and configure your Google Analytics account
2. Add GA tracking code to your pages
Paste the global site tag into the <head> section of every page, or add it with Google Tag Manager.
3. View reports
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 traffic data and verify that GA is set up correctly.
The problem(s) with GA
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 tools like Google Analytics to be overwhelming (and that was before GA4).
2) It 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 behavior analytics—to complete the picture and find out how users are really experiencing 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. 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.
Getting set up with a 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 and scroll with heatmaps
The easiest way to track and visualize where users click, tap, 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.
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
When you’re ready, 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 easy-to-use behavior analytics software used on over 900,000 websites worldwide.
Sign up for Hotjar with your Google account or email address. There’s a free forever basic plan to get you started.
2. Add Hotjar’s tracking code to your website
3. Create a new heatmap
Once you’re in the Hotjar dashboard, select “Heatmaps” from the left column, then click the green “New Heatmap” button.
Name your heatmap something descriptive (e.g. “product landing page”), then select a format (manual or continuous). The free plan will create a heatmap from a sample of 1000 pageviews.
Enter the URL of the page you want to track, and hit the “Create Heatmap” button to finish.
And that’s it: you can view your new Hotjar heatmap from the first recorded pageview.
It will look something like this:
You can view heatmaps by device (desktop, tablet, or mobile) and heatmap type (click/tap, scroll, or move).
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.
Tracking in action:
UX designers at Bannersnack, a graphic design platform, used 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.
See how users behave with session recordings
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 user replays) are renderings of real user actions as they browse a website. Recordings show mouse movement, clicks, taps, and scrolling across multiple pages on desktop and mobile.
Have a look at a real session recording in action to see what we mean.
1. Activate Recordings on your site
Select the “Recordings” menu in the left column, then click the green button to set up a new recording snapshot.
2. Start recording
Choose your recording type (the free plan will give you a sampled snapshot of 100 recordings), and hit the “Start Recording” button.
And that’s it: you're now tracking user session activity. Once you’ve had some traffic, your Recordings dashboard will look something like this:
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: if you’re using Google Optimize for A/B testing, you can automatically filter Hotjar Recordings by Experiment ID.
In the Recordings dashboard, go to Add Filter > Google Optimize and paste/select the relevant Experiment ID.
Tracking in action:
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).
Even a single-question survey can give you valuable insight and lead to UX improvements and business growth.
💭 Understand your users with Hotjar
Use Hotjar to safely track user behavior and understand how people experience and interact with your website or app.Sign up now. It's free!
How do I track user behavior on a website?
The easiest way to track user behavior on a website is to set up a popular analytics tool such as Google Analytics and Hotjar Heatmaps and Recordings.
What can I track on a website?
You can track three main types of user behavior on any website:
How do I track user activity on an app?
You can track user activity on an SPA (single-page application) with popular tools like Google Analytics and Hotjar. Some tracking tools, such as Google Analytics and Kissmetrics, can also track iOS and Android app activity.