Disable Google Analytics from Tracking You
GeekThis remains completely ad-free with zero trackers for your convenience and privacy. If you would like to support the site, please consider giving a small contribution at Buy Me a Coffee.
With over 65% of the top one-million websites using Google Analytics (according to BuiltWith), it should give you pause and make you think about how all of this information is being used. We even use Google Analytics on GeekThis to view how many visitors frequent each page. If you are unaware, Google Analytics is a website statistics service that tracks and reports traffic. Google Analytics tracks the acquisition of visitors, what pages visitors frequent, how long they spend on each page, and much more. The information that is presented to the website owner doesn’t include personal information, but a lot of information can still be gathered about the visitors (or specific visitor) to a website.
There are a few reasons to opt-out of Google Analytics. The first is to partially prevent websites from tracking your activity. Google Analytics can track various on-page events such as clicking on a video, clicking on a link to go to a different website, or how long you are spending on a web-page. Websites can still track what pages you visit on their site though by using server logs. Secondly, preventing Google from having information on websites you visit is a large reason to start opting out of Google Analytics. Finally, if you’re a web developer, opting out of Google Analytics is a quick way to prevent seeing traffic from yourself inside of your reports when you are testing a new page.
Google Analytics Opt-Out Extension
If you decide that the Google Analytics Opt-Out Extension is right for you, visit the download link below. It works on Google Chrome, Firefox, Internet Explorer, Opera, and Safari.
Block Google Analytics using a Firewall
If you have the ability to block IP ranges or domain names through a
firewall, then blocking Google Analytics for your whole network is
another option. I generally avoid blocking services by IP addresses
since the IP addresses can change without notice or multiple services
might use the same IP address. If your firewall can block DNS requests
to specific domain names, then adding a rule to block the domain
www.google-analytics.com would prevent
Google Analytics. Keep in mind that Google Analytics is loaded over
HTTPS, after the DNS request you most likely won’t be able to block the
request unless you block IP ranges or if the server uses
Block Google Analytics using the Hosts File
Before a DNS request is performed, the local
hosts file is used to
see if the host name / domain name has been assigned a specific IP
address. Similar to blocking Google Analytics DNS request, you can
assign a domain to a different IP address inside the
Depending on your operating system, the steps will vary, but this
method is possible with Linux, Windows, and OS X. Below are the steps
to block Google Analytics for Microsoft Windows. What we are going to
do is assign the Google Analytics domain name to a non-existent IP
address, causing any request to be terminated instead of being sent to
- Run Command Prompt as an administrator. This can be done by searching for “cmd” and then right click on the entry for “cmd” and then click on “Run as administrator.” For Windows 10 users, you can right click on the Start Icon and then click on “Command Prompt (Admin).”
- Type in the command
- At the bottom of the text file add a new line with the value of
0.0.0.0 google-analytics.comalong with a line for the domain
- Save the text file and then close out of all web browsers you have opened. Sometimes you will need to restart your computer for changes to take place.
# Copyright (c) 1993-2009 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. 0.0.0.0 google-analytics.com 0.0.0.0 www.google-analytics.com
Blocking Google Analytics is a start but the owners of websites ultimately have full control of how they can track you. Whenever you make a request to a website, your request is usually saved to a server log and the website owners can view what pages you visited, your user-agent, IP address, and other information about your request. There are also other popular website statistics services similar to Google Analytics that you should also opt-out of, such as Quantcast.