How Websites Track You
The main ways websites recognize and follow you, from cookies to fingerprints, and what each defense actually stops.
Key takeaways
- Tracking needs a way to recognize you again, which is usually a cookie, a stored value, a fingerprint, your IP address or a login.
- First-party tracking is done by the site you're visiting, while third-party tracking comes from outside companies whose code appears on many sites.
- Signing in with an email address links your activity across browsers and devices in a way that deleting cookies doesn't undo.
- Blocking third-party cookies and using a content blocker removes much routine tracking, but fingerprinting and logged-in tracking need other measures.
Websites track you by giving your browser an identifier, reading clues your browser and network give away, or asking you to identify yourself by signing in. Then they log what you do next to that identifier. Many pages also load code from other companies, so some of those logs end up in places you never visited on purpose.
You can't make this stop completely and still use the web normally. You can cut a lot of it down, though, and it helps to know which defense works against which technique, because none of them covers everything.
What happens when a page loads
When you visit a page, your browser requests the document from the site and then fetches everything the document asks for: images, fonts, scripts, video players, ad slots and analytics code. A busy page can contact dozens of different servers before it finishes loading.
Every one of those requests carries some information. The server sees your IP address, the time, the address of the file requested and a set of headers that describe your browser. It often sees which page caused the request too, at least the domain, through the Referer header. (The misspelling is baked into the standard.) You can see what your own browser sends with the request header echo tool.
None of that requires any special trick. It's how the web fetches files, which the page loading process depends on. Tracking is what happens when someone keeps those records and ties them together.
First-party and third-party tracking
A first party is the site whose address is in your address bar. A third party is any other domain the page loads something from.
First-party tracking includes remembering your cart, measuring which articles get read and noting which products you looked at. Some of it is what you want a site to do. Some of it feeds marketing you didn't ask for.
Third-party tracking is the part that follows you around. If the same analytics, advertising or social media company has code on a recipe site, a news site and a shoe store, and it can recognize your browser on all three, it can assemble a picture of your interests that no single site holds. That ability to connect separate sites is what most privacy tools aim at.
Each outside server receives at least your IP address and browser headers.
Cookies and other stored identifiers
The classic method is the cookie: a small piece of text a server asks your browser to store and send back on later requests. A cookie holding a random ID turns two unrelated visits into "the same browser came back."
Browsers also offer other storage, including local storage, session storage and a database called IndexedDB. Scripts can write an identifier into any of these and read it later. Cookies, pixels and local storage compared covers how they differ.
Browsers have steadily restricted cross-site storage. Several block or partition third-party cookies by default, which means a tracker's cookie on one site is invisible to it on another. The exact rules vary by browser and keep shifting, as the history of third-party cookies shows. In response, some trackers set identifiers in first-party storage, or ask the site to point a subdomain at the tracker's servers so its cookies look like the site's own.
Pixels, scripts and link decoration
A tracking pixel is a tiny image, often a single transparent dot, whose only purpose is to make your browser send a request. The request itself is the report. The same idea works in email, where loading the image tells the sender a message was opened; see tracking pixels in email.
Scripts do more than images can. A tracking script can note which buttons you press, how far you scroll, what you type into a search box and which items you add to a cart. Session replay tools go further and record enough page activity to reconstruct a visit. Well-configured tools mask sensitive fields, but configuration is up to the site.
Link decoration adds an identifier to the address you click. A link from an ad or newsletter may end in parameters that tell the destination which campaign sent you, and sometimes which individual click it was. You can usually delete these before sharing a link. The query parameter editor makes it easy to see what's attached.
Browser fingerprinting
Fingerprinting recognizes your browser by its characteristics instead of storing anything on it. A script can read your screen size, time zone, language settings, installed fonts, graphics hardware behavior and more. No single value is unusual, but the combination can narrow things down to very few browsers, sometimes one.
Because nothing is stored, clearing cookies doesn't help. A private window doesn't change your hardware either. Defenses work by making many browsers look alike, adding small amounts of randomness, or blocking known fingerprinting scripts. Browser fingerprinting and browser defenses goes into each approach.
A caution: installing many unusual extensions or changing obscure settings can make you easier to single out, because few other people share your exact setup.
IP addresses, logins and email matching
Your IP address is the network address websites reply to. It reveals your provider and a rough location, and for a home connection it may stay the same for a long time. Many people can share one address, especially on mobile networks, so it's an imperfect identifier. What your IP address reveals explains the limits.
Signing in removes the guesswork. Once you log in, the site knows it's you on any device, with or without cookies from earlier visits.
Sites and advertisers also use your email address or phone number as a matching key. They run it through a hash, a one-way scrambling function, and compare the result with another company's hashed list. Hashing doesn't make this anonymous: the same email always produces the same value, so it works perfectly well as an identifier.
What each defense stops
No single switch covers every method, so match the tool to the technique.
| Defense | Helps against | Doesn't help against |
|---|---|---|
| Block third-party cookies | Cross-site cookie tracking | Logins, fingerprinting, first-party tracking |
| Content or ad blocker | Known tracker scripts and pixels | Trackers served from the site itself, unknown ones |
| Clearing site data | Stored identifiers | Fingerprints, accounts, server records |
| Private browsing window | Local history, carried-over cookies | Your IP address, anything you sign in to |
| VPN | Your real IP address as seen by sites | Cookies, logins, fingerprinting |
| Email aliases | Cross-company email matching | Phone number and payment matching |
A content blocker is usually the largest single improvement because it stops many requests from happening at all. How ad blockers work explains the filter lists behind them. A VPN is often oversold here: it changes your apparent address and little else.
How to see the tracking for yourself
Your browser can show you most of what a page contacts. Many browsers have a shield or site information icon near the address bar that lists blocked trackers. For a fuller view, open developer tools, choose the Network tab and reload the page. Each line is a request, and the domain column shows who received it.
Look for domains that differ from the one in the address bar. Some are harmless infrastructure such as image hosting. Others have names that point to advertising or analytics. In the storage section of the same tools you can see which cookies and stored values the site created.
Try the same page with your content blocker on and off. The difference in the request count gives you a concrete sense of what the blocker is doing, and which site features depend on outside code. Developer tools for non-developers explains where to click.
A practical setup
You can do most of this in under half an hour.
- Update your browser and turn on its built-in tracking protection, choosing the stricter level if sites you use still work.
- Make sure third-party cookies are blocked or isolated. Menu names vary by browser and version.
- Install one reputable content blocker. Stacking several adds conflicts and permissions without much gain.
- Turn on Global Privacy Control if your browser or an extension offers it. It's a signal asking sites not to sell or share your data, and some privacy laws require covered businesses to honor it. Which ones depends on where you live.
- Stay signed out of large accounts in the browser you use for general reading, or keep them in a separate profile.
- Use a different email alias for shopping and newsletters.
What can go wrong
Strict settings sometimes break things. Embedded videos may refuse to play, single sign-on buttons may loop, and payment pages may fail partway. When that happens, relax protection for that one site instead of turning it off everywhere.
Blocking also has limits you can't see. A company can record your activity on its servers and pass it to partners directly, server to server, where your browser never gets a say. Opting out in account settings, and using legal rights to access or delete data where you have them, are the tools for that side. Those rights differ by country and state, so check your regulator's official guidance.
Finally, decide how much effort the risk deserves. Someone who dislikes being followed by ads needs far less than someone hiding sensitive research from a person who has access to their devices or network.