How to Fix: Disable Google Analytics in Firefox, Chrome, IE
Infopackets Reader Ray F. writes:
" Dear Dennis,
I have a problem with Google Analytics tying up my web browser with a 'waiting for www google-analytics.com' messages every time I visit a site. It shows this message in the action box on the lower left of the browser as the page loads. This goes for about 20 to 40 seconds and will not let me pass it; I have to wait for it to complete before the page will fully load. How do I get rid of this? Thanks for a great website and newsletter. "
My response:
This is a good question. The reason why the analytics is there is so that the website operator can see where his or her visitors are coming from, how much time they spend on certain pages, and most importantly, why visitors are leaving the site. Google Analytics is a very important metric if you are a webmaster. For the most part, Google Analytics should load seamlessly onto a web page without any lag issues - however, if it is causing problems for you, it is possible to disable the tracking using the Windows Hosts file.
How to Fix: Disable Google Analytics from Firefox, Chrome, IE
The Windows Hosts file is a small text file that overrides DNS (domain name services) so that your router or DNS service will be bypassed. In other words, when a website issues a request for your browser to visit www google-analytics.com, the hosts file will be looked up instead and will point to your machine for the IP address. This effectively causes a zero delay in resolving the DNS (since it's using a local IP) and thus the page will load much faster. Using this method should work fine for www google-analytics.com, however if you use it to block advertisements (for example) you may see 404 errors on the page.
For the record, others may recommend that you use things like "ad block plus" and "no script" plugins, but this is truly overkill and will result in broken web pages, rather than simply blocking a request to ping google analytics. In that case, my solution is 100% effective.
To do so:
- First, open an administrative command prompt. Click Start, type in "cmd" (no quotes); wait for CMD.EXE or Command Prompt to appear, then
right click it and select "Run as Administrator".
- Next, highlight the text below using your mouse:
copy c:\windows\system32\drivers\etc\hosts c:\windows\system32\drivers\etc\hosts_backup
echo 127.0.0.1 analytics.google.com >> c:\windows\system32\drivers\etc\hosts
echo 127.0.0.1 www.google-analytics.com >> c:\windows\system32\drivers\etc\hosts
echo 127.0.0.1 google-analytics.com >> c:\windows\system32\drivers\etc\hosts
echo 127.0.0.1 ssl.google-analytics.com >> c:\windows\system32\drivers\etc\hosts
echo this is a dummy line
- Right click over highlighted text above, and select Copy from the dialogue menu. Then, right click in the middle of the administrative command prompt window and select Paste from the dialogue menu. The text you copied in Step #2 should be output to the command line.
- Close your web browser and try to access a page with Google Analytics that was not previously working. It should be blocked now using the Windows Hosts file.
I hope that helps.
Got a Computer Question or Problem? Ask Dennis!
I need more computer questions. If you have a computer question - or even a computer problem that needs fixing - please email me with your question so that I can write more articles like this one. I can't promise I'll respond to all the messages I receive (depending on the volume), but I'll do my best.
About the author: Dennis Faas is the owner and operator of Infopackets.com. With over 30 years of computing experience, Dennis' areas of expertise are a broad range and include PC hardware, Microsoft Windows, Linux, network administration, and virtualization. Dennis holds a Bachelors degree in Computer Science (1999) and has authored 6 books on the topics of MS Windows and PC Security. If you like the advice you received on this page, please up-vote / Like this page and share it with friends. For technical support inquiries, Dennis can be reached via Live chat online this site using the Zopim Chat service (currently located at the bottom left of the screen); optionally, you can contact Dennis through the website contact form.
Most popular articles
- Which Processor is Better: Intel or AMD? - Explained
- How to Prevent Ransomware in 2018 - 10 Steps
- 5 Best Anti Ransomware Software Free
- How to Fix: Computer / Network Infected with Ransomware (10 Steps)
- How to Fix: Your Computer is Infected, Call This Number (Scam)
- Scammed by Informatico Experts? Here's What to Do
- Scammed by Smart PC Experts? Here's What to Do
- Scammed by Right PC Experts? Here's What to Do
- Scammed by PC / Web Network Experts? Here's What to Do
- How to Fix: Windows Update Won't Update
- Explained: Do I need a VPN? Are VPNs Safe for Online Banking?
- Explained: VPN vs Proxy; What's the Difference?
- Explained: Difference Between VPN Server and VPN (Service)
- Forgot Password? How to: Reset Any Password: Windows Vista, 7, 8, 10
- How to: Use a Firewall to Block Full Screen Ads on Android
- Explained: Absolute Best way to Limit Data on Android
- Explained: Difference Between Dark Web, Deep Net, Darknet and More
- Explained: If I Reset Windows 10 will it Remove Malware?
My name is Dennis Faas and I am a senior systems administrator and IT technical analyst specializing in cyber crimes (sextortion / blackmail / tech support scams) with over 30 years experience; I also run this website! If you need technical assistance , I can help. Click here to email me now; optionally, you can review my resume here. You can also read how I can fix your computer over the Internet (also includes user reviews).
We are BBB Accredited
We are BBB accredited (A+ rating), celebrating 21 years of excellence! Click to view our rating on the BBB.
Comments
Google Analytics solution
After you paste the text into the command window, you must but the enter key to execute the instruction.
dummy line
The final: echo "this is a dummy line" is there to negate the need to press Enter as it is a final command in the sequence, which has no meaning (other than to take the spot of having the press Enter).
How to Undo?
Thanks Dennis for posting this solution.
Just in case somebody runs into problems after executing this fix, exactly how would they "undo" the fix?
How to undo Hosts file changes
You would need to open an administrative command prompt, then copy and paste the line into the command prompt:
notepad c:\windows\system32\drivers\etc\hosts
Notepad will appear; delete these lines:
127.0.0.1 analytics.google.com
127.0.0.1 www.google-analytics.com
127.0.0.1 google-analytics.com
127.0.0.1 ssl.google-analytics.com
Then save the file.
Disable Google Analytics
Excellent! And thank you very much. Your knowledge on these things makes it so simple and easy. I looked at a half dozen or more websites that really make it into so much extra work in comparison. Thank you again!