Website Tracking Explained: How Cookies Follow You Online (And How to Block Them)
Website Tracking Explained: How Cookies Follow You Online (And How to Block Them)
Online tracking has become one of the most controversial topics on the internet. Almost every website tracks you in some way — sometimes to improve the user experience, sometimes to analyse traffic, and sometimes to show personalised ads that follow you everywhere.
But how does this tracking actually work? What role do cookies play? And most importantly: how can you block this tracking effectively?
What Is Website Tracking?
Website tracking refers to the techniques used to collect data about how you use a website — what pages you visit, what buttons you click, how long you stay, your device type, location, and much more.
Tracking is used by:
- Analytics tools like Google Analytics, Matomo or Plausible
- Marketing platforms like Meta Pixel, TikTok Pixel, HubSpot
- Ad networks like Google Ads, DoubleClick, Taboola
- Heatmap tools like Hotjar or Microsoft Clarity
Many websites depend on tracking to function — but the extent of the data collected often goes far beyond what the user expects.
The Role of Cookies in Tracking
Cookies are small text files stored in your browser. They can be used for harmless purposes like keeping your login active… or for more aggressive tracking across the internet.
There are two main types of tracking cookies:
1. First-Party Cookies
Created by the website you’re visiting.
Examples:
- Your login token
- Your language preference
- Basic analytics
2. Third-Party Cookies
Created by external domains (Google, Meta, advertisers). These allow tracking even across different websites.
This is why you may see ads for a product you viewed earlier — tracking cookies link your browsing history together.
How Websites Track You (Simplified)
A typical tracking system does three things:
- Loads a hidden JavaScript tracker
- Collects details about your browser, behaviour and device
- Sends the data to a tracking server
You rarely see this happening — but it's always there in the background.
๐ง Technical Example: What Tracking Really Looks Like
Here is a simplified but realistic example of how tracking is executed behind the scenes on many websites.
1. Example of a Tracking Script Loading
<script>
// Example of a simple tracking event sent automatically
fetch("https://tracker.example.com/collect", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
event: "page_view",
url: window.location.href,
userAgent: navigator.userAgent,
language: navigator.language,
screen: {
width: window.screen.width,
height: window.screen.height
},
timestamp: Date.now()
})
});
</script>
This script silently sends information about your visit to a tracking server.
2. How It Looks in the Browser Network Tab
Request URL: https://tracker.example.com/collect
Request Method: POST
Status Code: 200 OK
Payload:
{
"event": "page_view",
"url": "https://mysite.com/about",
"userAgent": "Mozilla/5.0...",
"language": "en-US",
"screen": { "width": 1920, "height": 1080 },
"timestamp": 1732439200000
}
3. Example of a Tracking Cookie
Set-Cookie: tracker_id=ab3f91d1c83e4f7;
Expires=Tue, 30 Nov 2027 12:00:00 GMT;
Path=/;
Secure;
SameSite=None
This lets the tracker identify the same user in future visits.
4. Example of Server-Side Tracking Logs
[2025-11-24 14:33:02] TRACK EVENT: tracker_id=ab3f91d1c83e4f7 ip=203.0.113.85 event=page_view url=https://mysite.com/about device=Desktop browser=Chrome 130 screen=1920x1080 referrer=https://google.com/
This is how tracking platforms build a profile of your browsing behaviour.
How to Block Website Tracking
You can block most trackers using one of the following methods:
1. Browser Extensions
- uBlock Origin — the most effective overall
- Privacy Badger — learns which domains track you
- Ghostery — clean interface, blocks analytics
2. Browsers With Built-In Anti-Tracking
- Brave — blocks everything by default
- Firefox — strong anti-tracker protection
- Safari — blocks cross-site tracking
3. Block Third-Party Cookies
On Chrome or Edge
Settings → Privacy → Third-party cookies → Block
4. Use DNS-Level Blocking
If you want to block trackers for all devices at home:
- NextDNS
- AdGuard DNS
- Pi-hole (self-hosted)
This prevents tracking servers from loading at all.
Final Thoughts
Tracking is everywhere — but understanding how it works gives you control. Whether through cookies, JavaScript, or hidden network calls, websites gather far more information than most users realise.
But with the right tools, you can block most forms of tracking and reclaim your online privacy.

Comments
Post a Comment