 | How to block google-analytics How can i stop google analytics, using a host file ? I am using xp pro her. |
|
|
|
 | Insert these lines into your C:\Windows\system32\drivers\etc\hosts file:
127.0.0.1 google-analytics.com
127.0.0.1 www.google-analytics.com
You may also want to install the Ghostery plugin for your browser which will block Google Analytics and many other "tracking code" sites as well.
-- Mischel Internet Security - Developer of TrojanHunter |
|
 OZOPremium join:2003-01-17 kudos:2 | reply to wolfi Here is my list of Google servers, that I keep in hosts file to block ubiquitous Google tracking:
# Google tracking sites:
127.0.0.1 google-analytics.com
127.0.0.1 www.google-analytics.com
127.0.0.1 ssl.google-analytics.com
127.0.0.1 googleanalytics.com
127.0.0.1 www.googleanalytics.com
127.0.0.1 ssl.googleanalytics.com
127.0.0.1 adservices.google.com
127.0.0.1 pagead.googlesyndication.com
127.0.0.1 pagead2.googlesyndication.com
127.0.0.1 fusion.google.com
127.0.0.1 www.googleadservices.com
127.0.0.1 partner.googleadservices.com
127.0.0.1 doubleclick.com
127.0.0.1 doubleclick.net
127.0.0.1 ad.doubleclick.net
127.0.0.1 pubads.g.doubleclick.net
127.0.0.1 urchin.com
127.0.0.1 service.urchin.com
The list is quite big, because unfortunately Windows hosts file doesn't support wildcard '*' and, therefore, each host name should be listed separately there.
-- Keep it simple, it'll become complex by itself... |
|
 | reply to MagnusM
MagnusM has got it.
Add to that this one too:
ssl.google-analytics.com
Also Note: Your anti-virus may see a non-standard hosts file as security threat and could possibly remove these custom entries. If that is the case, you may need to add your hosts file as an exclusion.
-Jim |
|
 | ..AND OZO, has it too . My post above showed up out of order and was before OZO's reply.
Awkward..........
-Jim |
|
 Jrb2Premium join:2001-08-31 kudos:3 | reply to wolfi Hi,
May I make an observation about adding:
127.0.0.1 ssl.google-analytics.com
I see in the MVPS HOSTS file that it is commented out:
# 127.0.0.1 ssl.google-analytics.com #[disabled = Firefox issues]
I'm just posting this as an observation and not as a recommendation. I don't know the reasons behind it and have to leave that discussion to others. |
|
 | reply to wolfi I would like to add that using the hosts file to block sites can cause slower page loading times if you don't have a web server running on localhost. The browser will have to wait for the connect to time out before determining that it cannot load the file. In addition, if you are also blocking ssl.google-analytics.com and are running a local web server then you may experience the same issue unless you also have SSL enabled for the local web server.
Also, if you have a very large hosts file, it can really slow down your machine. I have seen examples of a Windows XP box that was pretty much unusable because the hosts file had tens of thousand of entries. Clearing the hosts file fixed the problem and returned the system to its usual working state. For this reason I recommend Ghostery + Adblock instead. -- Mischel Internet Security - Developer of TrojanHunter anti-malware |
|
 Sindows 7 join:2006-09-13 Chilliwack, BC kudos:2 Reviews:
·TekSavvy DSL
·Shaw
·TELUS
| reply to wolfi 127.0.0.1 pagead.googlesyndication.com 127.0.0.1 pagead2.googlesyndication.com 127.0.0.1 adservices.google.com 127.0.0.1 ssl.google-analytics.com 127.0.0.1 www.google-analytics.com 127.0.0.1 imageads.googleadservices.com 127.0.0.1 imageads1.googleadservices.com 127.0.0.1 imageads2.googleadservices.com 127.0.0.1 imageads3.googleadservices.com 127.0.0.1 imageads4.googleadservices.com 127.0.0.1 imageads5.googleadservices.com 127.0.0.1 imageads6.googleadservices.com 127.0.0.1 imageads7.googleadservices.com 127.0.0.1 imageads8.googleadservices.com 127.0.0.1 imageads9.googleadservices.com 127.0.0.1 partner.googleadservices.com 127.0.0.1 www.googleadservices.com 127.0.0.1 apps5.oingo.com 127.0.0.1 www.appliedsemantics.com 127.0.0.1 service.urchin.com |
|
 dolphinsClean Up Our OceansPremium join:2001-08-22 Westville, NJ kudos:3 Reviews:
·Comcast
| reply to wolfi Firefox with NoScript add-on.

|
|
 OZOPremium join:2003-01-17 kudos:2 | reply to wolfi Keep in mind, that if you run a browser, made by Google (e.g. latest versions of Chromium), it will connect to Google analytic servers even if you block them with your hosts file.
They use directly hardcoded IP addresses (no name resolution needed). Moreover, to make the blocking harder, they require to use some of those servers to sign in into Google online accounts too... So, if you block those IP with firewall on your router, you'll not be able to sign in to your accounts. Bastards... :( Need an example? Here it is - 74.125.129.106. Try to block it and then sign in.
BTW, to add extra confusion they assign different direct and reverse name resolutions (watch for 74.125.129.106):
D:\>nslookup google-analytics.com
...
Name: google-analytics.com
Addresses: 74.125.129.106, 74.125.129.105, 74.125.129.147, 74.125.129.99
74.125.129.104, 74.125.129.103
Then check the 74.125.129.106 IP for it's name:
D:\>nslookup 74.125.129.106
...
Name: pd-in-f106.1e100.net
Address: 74.125.129.106
And this time the IP comes with a different name - pd-in-f106.1e100.net
That's why if you want to block analytics servers from unsolicited tracking connections you have to make your own special build and remove those hardcoded IP's (quite big subset actually) directly from the browser or simply use Iron browser instead of Chromium/Chrome...
-- Keep it simple, it'll become complex by itself... |
|
 | reply to wolfi The Google Analytics code is loaded via JavaScript from web pages with Google Analytics tracking enabled. This does indeed use the hostnames www.google-analytics.com and ssl.google-analytics.com. I just looked through the ga.js file and couldn't find any hard-coded IPs in there... this also wouldn't make any sense since it would circumvent the load-balancing features of using hostname resolution. -- Mischel Internet Security - Developer of TrojanHunter anti-malware |
|
 OZOPremium join:2003-01-17 kudos:2 | I was specifically talking about Google made browsers.
Can you block browsers from connecting to Google Analytics servers while you're browsing the Internet? -- Keep it simple, it'll become complex by itself... |
|
 | reply to wolfi Even if you use Google Chrome it's still not going to use IP addresses to access Google Analytics. If you have any links to back this up I'd love to see them.
EDIT: Try to access »74.125.129.106/ga.js in Google Chrome -- you will get a 404 error.
-- Mischel Internet Security - Developer of TrojanHunter anti-malware |
|
 NetFixerFrom my cold dead handsPremium join:2004-06-24 The Boro Reviews:
·Comcast Business..
·Vonage
·Cingular Wireless
·Comcast
| reply to OZO said by OZO:The list is quite big, because unfortunately Windows hosts file doesn't support wildcard '*' and, therefore, each host name should be listed separately there. The hosts file does not support wildcard '*' entries no matter what OS it is used on. Microsoft is not to blame for the lack of wildcard support. -- We can never have enough of nature. We need to witness our own limits transgressed, and some life pasturing freely where we never wander. |
|
 siljalineI'm lovin' that double widePremium join:2002-10-12 Montreal, QC kudos:17 Reviews:
·Bell Sympatico
| reply to wolfi MVPS Hosts blocks most, examples:
# [Google Inc] 127.0.0.1 domains.googlesyndication.com #[Parking Service] 127.0.0.1 pagead2.googlesyndication.com #[Google AdWords] 127.0.0.1 video-stats.video.google.com # 127.0.0.1 ssl.google-analytics.com #[disabled = Firefox issues] 127.0.0.1 www.google-analytics.com #[Google Analytics] 127.0.0.1 4.afs.googleadservices.com 127.0.0.1 pagead2.googleadservices.com 127.0.0.1 partner.googleadservices.com 127.0.0.1 www.googleadservices.com 127.0.0.1 apps5.oingo.com #[Microsoft.Typo-Patrol] 127.0.0.1 www.appliedsemantics.com 127.0.0.1 service.urchin.com #[Urchin Tracking Module] Also: For IE 9 - »ie.microsoft.com/testdrive/brows···ogle.txt |
|
 OZOPremium join:2003-01-17 kudos:2 | reply to MagnusM said by MagnusM:Even if you use Google Chrome it's still not going to use IP addresses to access Google Analytics. If you have any links to back this up I'd love to see them. Here is example of first (no any URL provided) start of Chromium browser, Version 24.0.1299.0 (162321):
 Tracking connections from Chromium browser
As you can see in this session it makes 5 secure tracking connections and it uses them until I close the browser...
1) Do you know any way to stop them?
2) If I block those names with my hosts file, browser will open those connections anyway. It means one thing - browser doesn't need name resolution to connect to those servers or it uses unknown aliases for them. -- Keep it simple, it'll become complex by itself... |
|
 | These are connections that Chrome uses for "safe browsing" features, to warn of malicious sites. You can turn this off in Chrome's advanced settings by unchecking "Enable phishing and malware protection". -- Mischel Internet Security - Developer of TrojanHunter anti-malware |
|
 siljalineI'm lovin' that double widePremium join:2002-10-12 Montreal, QC kudos:17 Reviews:
·Bell Sympatico
| reply to Jrb2 I don't know why "MVPS" comments out that Firefox entry. Presumably due to feedback from Moz users saying this entry prevents from reaching some sites.
You can comment in and out sites via notepad as deemed necessary over time with your Browsing based on the sites you visit.
Many more experienced using non-standard Hosts file users maintain their own lists that they comment in at the bottom of the file at every release. |
|
 OZOPremium join:2003-01-17 kudos:2 1 edit | reply to MagnusM No, they're not. The first thing I always do is to un-check that option. The screenshot provided was taken when that option was clear too. Any other ideas?
With other run I may get other, but similar connections. If I resolve those connections and block corresponding IP's with firewall. It will try to connect to different servers. One of them I've mentioned in my earlier post: IP = 74.125.129.106, which could be referred as google-analytics.com or pd-in-f106.1e100.net. -- Keep it simple, it'll become complex by itself... |
|
 AVDRespice, Adspice, ProspicePremium join:2003-02-06 Onion, NJ kudos:1 | reply to OZO said by OZO:The list is quite big, because unfortunately Windows hosts file doesn't support wildcard '*' and, therefore, each host name should be listed separately there.
technically, does *any* HOSTS file "support wildcards"? -- --Standard disclaimers apply.-- |
|