Learn / Guides / Website tracking guide
Website tracking guide
Whether youâre a casual internet user or you work on a website or product, website tracking and product analytics are a fundamental part of your daily life online.
As an individual, youâre likely interested in protecting your privacy. As a marketer, or a UX or product person, tracking is what helps you optimize a site, fix bugs, improve UX, and achieve business growth. When done right (and weâll show you how), website tracking can be beneficial to both users and businesses.
In this guide, we explore website tracking from both sides and cover what it is, how it works, and how to use a privacy-focused approach to tracking website activity.
đĄ Hey, product teams, watch real Hotjar use cases for Product Managers here
Hotjar's powerful tools help product managers with their daily workflow to formulate hypotheses, run experiments, and make informed decisions.
Skip to the bits you need:
What is website tracking?
Website tracking (or web tracking) is a method of collecting, storing, and analyzing user activity across one or several web pages.
Most online businesses use some form of tracking, including:
Traffic tracking to measure web traffic, e.g. with Google Analytics
UX tracking to measure user behavior and improve user experience, e.g. with Hotjar
Preference tracking to store individual site settings, e.g. shopping carts and login details
Advertising tracking to measure the performance of ad campaigns, e.g. Facebook ads
What website tracking can measure
Website or product tracking helps you:
See where visitors click, tap, and scroll on a page
Know if users are browsing on desktop or mobile
Find your best- and worst-performing pages
Optimize landing pages for conversion
Remarket an advertisement to previous website visitors
Measure the success of an email marketing campaign
The benefits of user tracking
When done right, website and user tracking can be beneficial to both individual users and businesses.
How tracking helps users
Website tracking technologies can help remember logins and preferences so you donât need to start from scratch every time you visit a site. For example, if you add a bunch of items to your Amazon shopping cart but donât check out, theyâll likely still be waiting for you a few days later.
Similarly, web tracking can help websites and products offer a more personalized experience, like tailoring content based on a visitorâs location or time zone:
Individual users can also benefit from improved UX if tracking is used to spot and fix bugs and create more enjoyable and useful product and site experiences.
How tracking helps businesses
Improving UX doesnât just benefit customers: happy users are good for business, leading to improved metrics like CTR (click-through rate), bounce rate, or conversion rate, and increased sign-ups and sales.
Website tracking also helps teams measure the performance of marketing campaigns, including SEO performance, as well as gain valuable insight to help with decision-making.
How websites track user activity
When you visit a website or app, data is collected from your device and web browser and used to tailor your experience or collect information on how and what you browse (this tracking usually happens automaticallyâ âkeep reading to learn how to stop it).
The two main types of website visitor tracking you need to know about are first-party and third-party: first-party tracking is data collected directly by the domain youâre visiting, while third-party tracking is when data is collected by a different party (weâll show you how to avoid this type of data collection below).
Hereâs an overview of the most common online tracking technologies and how they track behavior online.
IP tracking
Every internet connection has a unique IP (Internet Protocol) address thatâs associated with a country and approximate location.
Most website analytics tools, for example Google Analytics, use IP addresses to approximate user location, which can help teams understand where their audience is based, and segment data for insights.
For example, in Hotjar you can filter session recordings by user country to see how people in your target market interact with a page:
Cookies
Most web analytics tools install browser cookies, which are small text files that store data and can identify a user when they visit different pages on a websiteâor, in some cases, track users across different websites.
There are several types of website cookie:
First-party cookies â generated by the site youâre on, only active when youâre on that site (for example, an ecommerce site that remembers whatâs in your cart the next time you visit)
Third-party cookies â generated by a third-party site, can track users across multiple domains until the third-party cookie is deleted (for example, a Google Ad cookie used to serve targeted advertisements to the same user across different websites)
Session cookies â temporary cookies that only store data for a single session
Persistent cookies â permanent cookies that are stored until actively deleted
Pixel tracking
Tracking pixels work in a similar way to cookies, except they are tiny transparent images (measuring 1x1 pixels) that load via HTML on web pages or emails. Whenever a tracking pixel is loaded, analytics tools can report on whether users have opened an email or visited a page.
Fingerprinting
Fingerprinting is the process of compiling a unique identifier from an individualâs browser and computer settings. Fingerprints can then be used to track browsing activity across multiple pages or websites.
Any identifier can be used as part of a web fingerprint, including:
Operating system (OS)
Screen resolution
Installed fonts
Browser add-ons or extensions
Browser version and settings
Device tracking
Device dataâincluding OS, browser, and device type (i.e. desktop or mobile app)âis collected by many analytics tools, and can be used to troubleshoot website bugs and design issues on specific devices, browsers, or screen resolutions.
For example, Hotjar Recordings can be filtered by device, browser, and OS, which makes it easier to find bugs or barriers to conversion on specific setups:
Privacy-first web tracking
Whether youâre a business using tracking tools on your website or a user concerned about your privacy online, youâll need to know what good and bad web tracking looks like.
For example, at Hotjar we take a privacy-first approach to tracking and design our tools to record user interactions, not sensitive data. We call it âprivacy by designâ. Hereâs a quick rundown of some of our privacy featuresâuse these as a benchmark for finding other privacy-first tools:
Hotjar is GDPR, CCPA, and LGPD compliant (see more on those below)
We follow the âDo Not Trackâ flag on browsers
We do NOT collect users' IP addresses
Users can request to see and delete their data at any time
Data is never sold to or viewed by third parties
If youâre using any tracking tools on your product or website, youâll need to comply with relevant web tracking laws, regulations, and guidelines.
Understand your users with Hotjar
Use Hotjar to safely track user behavior and understand how people experience and interact with your website or app.
Web tracking laws
Recent developments in data privacy legislation have led to increased requirements for companies to disclose how they track, store, and use visitor data.
GDPR
The GDPR (General Data Protection Regulation) regulates how companies can handle data from EU individuals, regardless of where a company is based.
CCPA
The CCPA (California Consumer Privacy Act) protects the personal data of California residents in the USA.
LGPD
The LGPD (Lei Geral de Proteção de Dados) regulates how the personal data of Brazil residents is collected and processed.
How to stop a website tracking you
You can limit the number of ways that websites track you by taking a few small actions. Here are seven beginner-friendly ways to get started:
1. Turn on tracking protection in your browser
Turn on the Do Not Track (DNT) setting in your browser (here are instructions for Chrome and Firefox). Reputable website activity tracking tools, like Hotjar, will abide by DNT preferences.
In Firefox, you can also set Enhanced Privacy Protection to âStandardâ or âStrictâ to block social media and cross-site trackers and fingerprinting.
2. Block third-party cookies
If you block all cookies, most websites wonât work properly (for example, you probably wonât be able to sign in). But blocking third-party cookies helps you limit some cross-site online tracking. Many browsers now block third-party cookies by default, but in Chrome youâll need to go to Settings > Privacy and Security > Cookies and other site data and select âBlock third-party cookiesâ.
3. Delete cookies
Set your browser to automatically delete cookies when you quit, or try to manually delete cookies regularly. Just remember that youâll lose things like active logins and full shopping carts when cookies are removed.
4. Use a privacy browser extension or add-on
A privacy-focused browser extension, like Ghostery, can block website tracking scripts and help you understand which trackers are being used on a site, and what their purpose is.
5. Use a privacy-focused browser
A privacy-focused browser can provide additional website tracking blocking features. For example, Firefox blocks fingerprinting and cross-site cookies as standard, and Brave sends DNT requests by default.
6. Use a VPN
A VPN (Virtual Private Network), like ProtonVPN, will hide your IP address from websites. This does not stop websites from tracking you through other methods (e.g. cookies, pixels, or fingerprinting), but it will stop your ISP (Internet service provider) from collecting data on the websites you browse.
7. Block images in emails
When you block images by default, email marketing software like Mailchimp can't use pixels to track when you open emails. In Gmail, go to Settings > General > Images and select âAsk before displaying external imagesâ.
How to track website users (the right way)
Now you know what website tracking is and how to track with user website tracking privacy in mind, hereâs a quick overview of how to get started.
1. Pick the right tool to track what you need
First, ask yourself: why do you want to track website users?
Yes, website tracking tools allow you to track almost anything on any digital product, but you need to think about your end goal so you donât get stuck in a cycle of tracking, and reporting on metrics, just because you can.
For example, you might be trying to:
Increase traffic
Convert more customers
Increase sign-ups
Measure the value of ad spend
Increase usage of a product feature
Once youâve defined your goal, youâll be in a better place to find the right tool.
You can learn more about the best website tracking tools in the dedicated chapter of this guide, but here are a couple to get started with:
Google Analytics â to track website traffic
Hotjar Heatmaps and Recordings â to view visitor behavior
KissMetrics â to analyze product usage
2. Install the tracking script
Most website tracking tools require you to add a small snippet of JavaScript code to every page you want to track.
If youâre using Hotjar, you can add your unique tracking code to Google Tag Manager, via WordPress plugin, or manually copy and paste it into the <head> section of your website.
3. Analyze the data
As we mentioned above, thereâs no point collecting data youâre never going to look at. Once youâve got some numbers rolling in, itâs time to start analyzing the data in relation to your main tracking goal.
If youâre analyzing a heatmap to increase conversions, for example, you can start by asking yourself:
Are people seeing important content?
Are people clicking on key page elements (links, buttons, and CTAs)?
Are they confused by non-clickable elements?
Are they getting distracted?
Are they experiencing issues across devices?
Youâll get more out of website tracking if you analyze data from different sources. For example, combining Hotjar with Google Analytics will help you improve UX by learning both what happens on your site, and why.
Understand your users with Hotjar
Use Hotjar to safely track user behavior and understand how people experience and interact with your website or app.