Methods to Block Google Analytics from Tracking You
Below I’ll be showing you several methods you can implement in order to prevent Google Analytics from tracking your browsing and internet activity.
1. Installing Google Analytics Opt-Out extension
Using this official extension is the best way to opt-out from Google Analytics. The main advantage of using the Opt-Out extension is that you can make sure it always works even when Google makes changes to its services.
However, there are also some downsides to this extension. One is that you have to install it on your computer. Installing software to stop other software from tracking your activities is not very productive. The other disadvantage is that this extension can’t stop Google from knowing about the websites you visit. It just blocks sending events to Google Analytics.
The Google Analytics Opt-Out Extension works with all major browsers, including Google Chrome, Firefox, Safari, Internet Explorer, and Opera.

2. Installing the “Block Yourself from Analytics” Chrome extension
Another simple method to block Google Analytics is using a Chrome extension called “Block Yourself from Analytics.” When installed, it restricts Google Analytics from tracking your visits to specific websites. What’s interesting about this extension is that it allows you to set a list of domains you don’t want your visits to get tracked.
Below are the steps to install and setup the “Block Yourself from Analytics” Chrome extension.
Step 1: Open Chrome browser
Step 2: Visit this link to find the extension.
Step 3: Click on the blue “Add to Chrome” button and click “Add Extension” in the following popup.

Press “Add Extension”.

Step 4: Now, you can see an orange icon in your browser’s top right as below.

Step 5: Now, navigate the website that you don’t want your visits to get tracked by Google Analytics. Then click on that small orange icon on the browser and click “Block Analytics for this website.”
You can also manually add (without navigating to the website) any website/websites you want or view the list of websites you have blocked by clicking on “Options.” To manually add a website using the “Options” area, enter the URL of the website in the text field at the bottom of the window and click “Add.” In the end, make sure to save all the websites you added before exiting.

The main drawback of this method is that it only works with the Chrome browser.
3. Using a firewall to block Google Analytics
If you have a firewall that can block specific IP ranges or domain names, you can block Google Analytics for your entire network. This option also has some downsides, such as IP addresses changing without notice or multiple services using the same IP address. If your firewall can block DNS requests to particular domain names, you can add a rule to block the domain google-analytics.com and www.google-analytics.com to opt-out Google Analytics.
4. Using Hosts file to block Google Analytics
You can also opt-out Google Analytics by assigning the domain name to a different IP address in the hosts file. That is because the local hosts file is checked to see if the host name/domain name is assigned a particular IP address before serving a DNS request.
This is similar to blocking the DNS request of Google Analytics, which we discussed earlier. The steps of this method will vary depending on your operating system, but it works with OS like Linux, Windows, and macOS.
Following are the steps to opt-out Google Analytics for Microsoft Windows. Here, we are going to assign the domain name of Google Analytics to a non-existing IP address, leading any request to it getting terminated instead of sending it to Google.
Step 1: Run Command Prompt in administrator mode.
To do that, search for “cmd” in the search bar and right-click on the “Command Prompt” entry that appears there.
Then click on the “Run as administrator” option, and it will launch the Command Prompt as an administrator.
Windows 10 users will have to right-click on the Windows Icon and select “Command Prompt (Admin).”
Step 2: Type the below command in the Command Prompt.
notepad “C:\Windows\System32\drivers\etc\hosts”
It will open up the hosts file on your computer.
Step 3: Add a non-existing IP for Google Analytics.
Add two lines at the bottom of the hosts file as following:
0.0.0.0 google-analytics.com
0.0.0.0 www.google-analytics.com
Step 4: Finally, Save the hosts file and close all the open web browsers.
Sometimes, you may need to restart your computer for these changes to become effective.

5. Using Ad-Blockers
Ad blockers have gained more attention recently due to their wide usage. While their main purpose is to block the annoying (marketing) ads that follow you across the internet, they also have the ability to affect the process of collecting traffic data in various means, such as by blocking Google Analytics.
Ad Blockers do that by blocking any attempts of Google Analytics JavaScript library to transfer data between websites and analytics servers.
By default, many ad blockers blacklist Google Analytics, while some ad blockers need to be configured to do so.
- The uBlock Origin is a popular ad blocker that comes as a Chrome extension. It blocks Google Analytics by default and is used by more than 10 million users.
-
The Adblock Plus Chrome extension can be used to block Google Analytics by enabling the Easylist option.
Below are a few simple steps to install and configure Adblock Plus free ad blocker and configure it to block Google Analytics.
Step 1: Visit the Chrome Web Store page of the Adblock Plus extension.

Step 2: Click on the “Add to Chrome” button and then click on the “Add Extension” button in the following popup.

Step 3: Now, you will see a small Adblock plus icon in your browser, and it will display a popup when you hover on it.

Step 4: Click on the Settings icon of the top right of the popup and go to the “Advanced Tab” of the settings page.

Step 5: Turn on the “Easy List” option there to block Google Analytics.
In addition to the above two ad blockers, there are also some other popular ad blockers that are capable of blocking Google Analytics, such as AdBlock Pro, AdGuard AdBlocker, AdRemover, Ghostery, Simply Block Ads! and SuperBlock Adblocker.
5. Using the Brave Browser
Brave is an open-source, Chromium-based web browser that is free to download and use. It is similar to all the other standard browsers in enabling users to navigate websites, view any online content, and run web applications.
However, the major differentiating factor of Brave among other Chromium browsers is its focus on user privacy. Brave achieves this by blocking all ads, third-party cookies, and website trackers like Google Analytics by default. Therefore, using Brave browser is a good option for hiding your online activity from Google Analytics while surfing the web.
Since the Brave browser also acts as an ad blocker, blank spaces will appear in the areas of websites that contain ads. Sometimes, the pages won’t load properly and in such cases, you will have to either select a different browser or change the ‘Shields Up’ setting to ‘Shields Down’ to turn off the privacy and security protection of Brave.
Below are few simple steps for downloading and installing the Brave browser.
Step 1: Visit the following link to navigate to the official site of Brave browser.
Step 2: Then, click on the required download option in the middle of the page, and it will download the installable file of the Brave browser.

Step 3: Double click on the installable file, and it will generate a prompt message as shown below. Click “Run” there, and it will install and launch Brave browser on your PC.
That’s it.
Looks and works like any other web browser:

6. Using a Script blocker to disable JavaScript
Finally, you can also use an extension that blocks JavaScript from loading for particular domains or servers to opt-out Google Analytics. There are numerous extensions that are capable of serving this purpose.
You can even disable JavaScript from your web browser. But this method is not recommended since almost all modern websites require JavaScript to run properly and blocking JavaScript will break most website from loading properly.