Skip to content

Original privacy and security research, news and free tools since 2018, cited by the FBI, CISA and the World Economic Forum See our research

Cited by the FBI, CISA and the World Economic Forum

Guide

How to Prevent Google Analytics from Tracking You

Published Updated

Shanika W.

By Shanika W.

Cybersecurity Analyst

Miklos Zoltan

Updated and fact-checked

12 Comments

To block Google Analytics, add uBlock Origin Lite to your browser or use Brave. In Safari, Firefox and Edge one setting is enough.

Google Analytics runs on about a third of the websites DuckDuckGo’s tracker crawler checks, so it’s one of the trackers you meet most often. Google’s own opt-out add-on works too, though it lets the script load first and only then tells it to keep quiet. Apps on your phone need a different fix.

Quick answers:

Safari, Firefox or Edge: change one privacy setting (chapter 1)
Chrome: add uBlock Origin Lite (chapter 1)
Google’s opt-out add-on: what it does and doesn’t do (chapter 2)
Apps on Android or iPhone: a tracker-blocking DNS (chapter 3)
Every app on a computer, or your whole home network: hosts file or DNS (chapter 4)
Your own visits to your own site: the internal traffic filter (chapter 7)

How we checked: For this update we read Google’s Analytics and tag platform help pages, Apple’s WebKit blog and Safari guide, Mozilla’s and Microsoft’s help pages on tracking protection, Chrome’s and Edge’s extension timelines, the pages of Brave and the uBlock Origin Lite project, and the current EasyPrivacy, Disconnect, DuckDuckGo and AdGuard DNS tracker lists, on November 6, 2026.

Block Google Analytics in your browser

Every major browser can block Google Analytics. Only Brave does it without being asked.

Where
Blocks it by default
What to do
Safari (Mac, iPhone, iPad)
Private Browsing only Known trackers are blocked in private windows.
Turn on advanced tracking and fingerprinting protection for all browsing, or add uBlock Origin Lite.
Chrome
No No tracker blocking built in.
Add uBlock Origin Lite. The full uBlock Origin stopped working in Chrome in July 2025.
Firefox
Private windows only Standard protection blocks tracking content only in private windows.
Set Enhanced Tracking Protection to Strict, or add uBlock Origin, which still works in Firefox.
Edge
Only at Strict The default Balanced level lets analytics trackers through.
Set tracking prevention to Strict, or add uBlock Origin Lite.
Brave
Yes Shields block third-party ads and trackers by default.
Nothing to add. Keep Shields on.
Apps on Android
No Apps can carry Google Analytics for Firebase.
Set Private DNS to a tracker-blocking DNS service (chapter 3).
Apps on iPhone and iPad
No Safari blockers don’t reach other apps.
Install a tracker-blocking DNS profile (chapter 3).
A blocker stops the Google Analytics script from loading at all. Google’s opt-out add-on lets it load and tells it not to send anything (chapter 2).
Based on Apple’s WebKit blog and Safari guide, Mozilla and Microsoft help pages, Chrome’s extension timeline, Brave’s and uBlock Origin Lite’s pages, and the EasyPrivacy, Disconnect and DuckDuckGo tracker lists. Checked November 6, 2026.

Safari

In Private Browsing, Safari blocks the network requests of known trackers. Its list takes only the domains that both DuckDuckGo’s tracker data and the EasyPrivacy list flag, and Google Analytics is on both. Normal windows let it run; Intelligent Tracking Prevention only limits how long its cookie survives.

You can have the private-window protection everywhere:
Mac: Safari > Settings > Advanced, turn on “Use advanced tracking and fingerprinting protection” and set it to all browsing.
iPhone and iPad: Settings > Apps > Safari > Advanced > Advanced Tracking and Fingerprinting Protection > All Browsing.

Apple says all of Private Browsing’s newer protections then apply to normal browsing as well. If you’d rather use a content blocker, uBlock Origin Lite is in Apple’s App Store for Safari on Mac, iPhone and iPad.

Chrome

Chrome has no tracker blocking of its own, and since Chrome 138 in July 2025 it no longer runs the full uBlock Origin. Google switched off every extension built on the old Manifest V2, and users can’t turn them back on. The replacement, uBlock Origin Lite, ships with EasyPrivacy among its default lists, and EasyPrivacy blocks google-analytics.com and analytics.google.com. Incognito mode doesn’t help much here. Google Analytics still runs in an incognito window; it just loses its cookie when you close it.

Firefox

Firefox’s Enhanced Tracking Protection runs on Disconnect’s tracker list, which files Google Analytics under analytics, one of the categories Firefox’s tracking lists include. In the default Standard mode, though, tracking content is blocked only in private windows. Switch to Strict to block it in all of them: Settings > Privacy & Security > Enhanced Tracking Protection > Strict (newer versions put it under Advanced settings), or click the shield left of the address bar and open the protection settings. Strict can break parts of some pages, and the shield turns it off for one site.

Firefox also still runs the full uBlock Origin. Mozilla kept the older extension interface next to the new one, so the extension that left Chrome works as before.

Edge

Edge’s default tracking prevention, Balanced, lets analytics trackers through. Microsoft’s own table blocks that category only at Strict. To change it: Settings > Privacy, search, and services > Tracking prevention > Strict. Microsoft warns that some sites may not behave as expected. Edge is also turning off Manifest V2 extensions for home users between August and the end of 2026, so the full uBlock Origin is on its way out there too; uBlock Origin Lite is in the Edge Add-ons store.

Brave

Brave blocks third-party ads and trackers by default, and that covers the Google Analytics script on ordinary sites. Leave Shields up and there’s nothing to install.

Google's opt-out add-on: what it does and what it doesn't

Google makes its own Google Analytics Opt-out Browser Add-on for Chrome, Firefox, Safari and Edge. Other browsers, Opera among them, get a “not supported for your browser” message. With the add-on installed, the Google Analytics JavaScript (gtag.js and analytics.js) still loads on every site that uses it, but it doesn’t send your visit to Google Analytics.

That’s also where it falls short. The script still comes from Google’s servers, so your browser still contacts Google on every one of those sites. Google’s help page lists what else it doesn’t stop: data sent to the website itself, the site’s other analytics tools, and data that reaches other analytics services another way. A blocker from chapter 1 keeps the script from loading in the first place.

Is it safe? It comes from Google (the Chrome Web Store lists Google Ireland as the developer), about a million people use it in Chrome, and the listing says it doesn’t collect or use your data. The last update was in May 2024. It’s an odd arrangement, installing a Google product so that another Google product leaves you alone, but it does what it says.

It suits you if you want out of Google Analytics without a content blocker changing how sites look. It does nothing for apps, which chapter 3 covers.

On your phone and in apps

Phone browsers are covered by chapter 1: Safari’s setting on iPhone and iPad, Brave on Android and iPhone, and Firefox for Android, which has Enhanced Tracking Protection too. Chrome on Android doesn’t take extensions, so there you’d switch browsers or use DNS.

Apps are the bigger gap. Google Analytics for apps comes with Google’s Firebase SDK, which collects basic usage data without the developer writing any extra code, and no browser setting reaches it. Firebase’s own bug tracker shows the SDK reporting to app-measurement.com.

What does reach apps is a DNS service that refuses to look up tracker domains:
AdGuard DNS: the free public Default server blocks ads and trackers. Its filter list blocks google-analytics.com, analytics.google.com and app-measurement.com (checked November 6, 2026).
NextDNS: free up to 300,000 queries a month, after which it keeps working without blocking; Pro costs $1.99 a month. You pick the blocklists yourself.

Android: Settings > Network & internet > Private DNS > Private DNS provider hostname, enter dns.adguard-dns.com and tap Save. If your phone puts it somewhere else, search Settings for “Private DNS” (Android Help).
iPhone and iPad: download AdGuard DNS’s configuration profile from its site, then open Settings, tap Profile Downloaded and Install.

A few VPN apps do the same job while they’re connected. Proton VPN’s NetShield blocks ads, trackers and malware by default on paid plans, and Mullvad’s app has DNS content blockers under Settings > VPN settings. They stop when the VPN does, and the DNS settings above work without one.

Every app on a computer or network: hosts file and DNS

The hosts file on Windows, macOS and Linux tells the computer which addresses to use before it asks any DNS server. Point the Google Analytics domains at 0.0.0.0 and every browser and app on that computer stops reaching them.

Windows: search for Notepad, right-click it and choose Run as administrator. Open C:\Windows\System32\drivers\etc\hosts (set the file type to All files), add the lines below at the end and save.
Mac and Linux: in Terminal, run sudo nano /etc/hosts, add the lines and save.

0.0.0.0 google-analytics.com
0.0.0.0 www.google-analytics.com
0.0.0.0 region1.google-analytics.com
0.0.0.0 ssl.google-analytics.com
0.0.0.0 analytics.google.com

The four google-analytics.com addresses are the ones DuckDuckGo’s Tracker Radar found in use (data of October 30, 2026). If you use Google Analytics for your own site, leave out analytics.google.com, because that’s also where your reports live. Restart the browser afterwards.

The hosts file has one weakness. It doesn’t take wildcards, and Google lists its collection domains as *.google-analytics.com and *.analytics.google.com, so a new subdomain gets through until you add it. You can add www.googletagmanager.com too, where the script itself loads from, but that also stops Google Tag Manager, and sites that load other tools through it lose those.

A DNS service keeps the list up to date for you. Set AdGuard DNS or NextDNS (chapter 3) in your router and every device at home uses it, smart TVs and consoles included. Or run Pi-hole, a DNS blocker you install on a small computer on your own network.

What blocking doesn't stop

Blocking the script keeps your visits out of Google Analytics. A site can still count you in other ways, and some of them get past any blocker.

Clicking “reject” on a cookie banner

It depends on the site’s setup. Under Google’s consent mode, a site can use the basic version, where Google’s tags wait for your answer and send nothing if you decline. Or it can use the advanced version: the tags load straight away and, after you decline, send measurements without cookies. Those include your consent choice, the time, your browser’s user agent, the page you came from and a random number for each page load. You can’t tell from the banner which one a site runs. A blocker stops both.

Tracking from the site’s own domain

With server-side tagging, your browser sends data to a server the site runs, which passes it on to Google. Google recommends putting that server on the site’s own domain. Google tag gateway goes one step further and serves Google’s scripts from the site’s own domain through its content delivery network, a setup Google calls “more durable”. Blocklists that work by domain name can’t tell those requests from the rest of the site.

The site’s own records

Your visit still reaches the website itself. It lands in the server logs and in any other analytics tool the site runs, which a blocker may or may not catch. Sites can also recognise a browser by its fingerprint, without any cookie.

A VPN on its own

A VPN changes your IP address, not the script. Google Analytics still runs and records the VPN server’s location instead of yours, since it works out location from the IP address. A VPN’s tracker blocker, where it has one, is a DNS blocker like those in chapter 3.

What Google Analytics records, and when it's linked to you

For the site owner, Google Analytics records the pages you open and what you do on them. Its standard enhanced measurement events cover page views, scrolling, clicks on links to other sites, site searches, video plays, file downloads and form use. Each visit also carries your device, your browser and an approximate location.

To recognise you next time, it sets two first-party cookies, _ga and _ga_ followed by an ID, which last two years by default. Google Analytics 4 doesn’t log or store IP addresses; it uses them to work out where you are.

The site owner sees counts and charts, not your name. Google can do more when a site turns on Google signals, which adds data from Google users who have consented to ads personalization: reports across devices, demographics and interests, and remarketing. If you’re signed in to Google, turning off personalized ads in My Ad Center takes you out of that group. Blocking keeps Google Analytics from seeing the visit at all.

In Europe the bigger fight was about where the data goes. In 2022, data protection authorities in Austria and France found that sites using Google Analytics broke the GDPR by sending visitor data to the US (noyb). The EU–US Data Privacy Framework of July 10, 2023 made such transfers lawful again, and the EU General Court upheld it on September 3, 2025. Our GDPR fines tracker lists what regulators have fined since.

Google Analytics is only one of Google’s trackers. What you do in Search, YouTube and Chrome sits in your Google account, and our guide to privacy-friendly Google alternatives covers ways out of that.

Site owners: keep your own visits out of your reports

If your own visits skew your numbers, any blocker from chapter 1 takes you out of Google Analytics everywhere, your own site included. To leave your browser alone and drop only your visits from your own reports, use Google Analytics 4’s internal traffic filter:

1. Define your traffic: Admin > Data collection and modification > Data streams, pick the web stream, then Configure tag settings > Show more > Define internal traffic > Create. Name the rule, give it a traffic_type value and enter your IP address or range.
2. Exclude it: Admin > Data collection and modification > Data filters > Create Filter > Internal Traffic, choose Exclude and set the filter to Active.

Google says the filter takes 24 to 36 hours to apply, and the data it excludes is never processed, so it can’t be recovered later. That suits an office or home connection with a fixed address.

If your IP address keeps changing, the Block Yourself from Analytics extension for Chrome blocks Google Analytics only on the sites you list. It comes from a small independent developer, not Google: version 2.0 from November 2025, about 3,000 users. Google’s opt-out add-on also works, but it takes you out of Google Analytics on every site, not just yours.

Frequently Asked Questions

Some people found answers to these questions helpful

Does uBlock Origin block Google Analytics?

Yes. Its default lists include EasyPrivacy, which blocks Google Analytics' scripts and data requests. The full uBlock Origin still works in Firefox. Chrome switched it off in July 2025, so there you need uBlock Origin Lite, which also blocks Google Analytics with its default lists. Edge is phasing the full version out by the end of 2026.


Does Safari block Google Analytics?

In Private Browsing, yes. Safari blocks known trackers there, and Google Analytics is on both lists Safari draws from. In normal windows it doesn't, unless you set advanced tracking and fingerprinting protection to all browsing (Mac: Safari > Settings > Advanced; iPhone and iPad: Settings > Apps > Safari > Advanced).


Is the Google Analytics opt-out add-on safe?

It's made by Google, about a million people use it in Chrome, and its store listing says it doesn't collect or use your data. The real question is what it leaves out: the script still loads from Google's servers, and the site can still measure you in other ways.


Does rejecting cookies stop Google Analytics?

Not always. With the advanced version of Google's consent mode, Google's tags still send measurements without cookies after you decline: your consent choice, the time, your browser's user agent and the page you came from. With the basic version nothing is sent. The banner doesn't tell you which one a site uses, and a blocker stops both.


How do I block Google Analytics on Android or iPhone?

In the browser, use Brave, Firefox on Android, or Safari with advanced tracking and fingerprinting protection set to all browsing. For apps, use a tracker-blocking DNS: on Android, set Private DNS to dns.adguard-dns.com; on iPhone and iPad, install AdGuard DNS's configuration profile.


Does a VPN block Google Analytics?

Not by itself. Google Analytics still runs and records the VPN server's location instead of yours. Some VPN apps include a DNS blocker that stops trackers while you're connected, such as Proton VPN's NetShield on paid plans and Mullvad's DNS content blockers.


12 Comments

  • phanerothyme

    April 13, 2025 3:36 pm

    The simplest method … Use uBlock Origin, load the website, then block Java Script and re -load the same URL ….

  • Dands

    June 22, 2024 7:05 pm

    Author of this post says Google Analytics Opt-Out extension works with Opera browser but when I tried to add it — Chrome message says “The Google Analytics Opt-out Browser Add-on is not supported for your browser.
    Available for Google Chrome, Mozilla Firefox, Apple Safari and Microsoft Edge.

  • Rob A.

    December 21, 2023 11:57 pm

    I’m not so much interested in protecting my privacy as I am in playing games on Arkadium.com without them choking on Google Analytics.

  • Ted Rodriguez

    December 5, 2023 6:23 am

    How can I block Google analytics on my Android Version 12 phone?

    • johan

      June 19, 2025 10:33 am

      You can create an account to Adguard DNS, configure it on your phone and then create a user-filter to block the dns http://www.google-analytics.com, so this dns will be block on your phone

  • Ian

    October 13, 2023 6:11 am

    Great Work

  • Mr andriod

    September 19, 2023 12:47 am

    I really need some help,i have an x that is in evdrything i own i go get a new straight talk phone and shes in it b4 the days out i really really need help i just dont no who to trust,she comes from all directions and it seems like theres something new everyday

  • Mahhn

    February 16, 2023 8:20 pm

    Fyi, JBL software (and I am sure others also) has google analytics built in, and reports to goog. I came here to see what I could do besides blocking their subnets. Thank you for the info on modding the Host file so at least I’m mitigating some of the spyware.

  • Anne

    June 29, 2022 3:50 pm

    Nice advice. But couldn’t you just use a privacy browser such as duck and a VPN?

    • don

      January 26, 2024 2:51 am

      I’m using duck but it doesn’t block google trackers ever after a fire burn. Do you know how to scorch them off too?

  • Rich

    November 10, 2021 5:03 pm

    Yes, I just got that Ah Haa! Moment yesterday while clearing apps from my phone after running “Norton Apps Cleaner” when I suddenly realized why there are so many “FREE” apps and allowing them access to suck the personal information out of my phone and selling it actually ends up costing me way more!! Sure is nice to get a wake up moment like that so getting rid of all non essential apps!

  • Donald duck

    October 29, 2021 5:24 pm

    Interesting post

    I am using adguard premium on my mobile phone as that’s where most of my internet activities are done and adguard seems to be super effective in blocking Google’s analysis process as well as blocking a large percentage of ads

    I just hope that adguard can protect other data that especially installed apps may be collecting such as location info mobile number mobile make model and other sensitive areas as one thing I find with apps is they are shameful people who are collecting data without you knowing and without permissions