Warning: This blog entry was written two or more years ago. Therefore, it may contain broken links, out-dated or misleading content, or information that is just plain wrong. Please read on with caution.
Did you know that you are being tracked on the internet? Of course you did, everyone knows google is everywhere these days. How else would you see the same adverts for male pattern baldness follow you around from site to site after you went doing research "for a friend".
Maybe It Is A Big Deal After All
There was a time when I thought this was no big deal. What harm could it really do if google knew what kind of things I was most interested in buying so they could target advertising for me, it sounded like a win/win situation to me. After all they have a code of conduct that states this on the first line of the first paragraph:
“Don’t be evil.”
However after recent (and not so recent) incidents where google has acted questionably in relation to peoples privacy, I have started to limit my interactions with google services. For reference here are some of the incidents I'm talking about:
- Google Faces Fine Of $22.5M For Bypassing Users Privacy Settings On Safari
- Google Gathers Data From Unsecured Wifi Networks With "Street View" Cars
- Oh and an update on this last one. This came out over the weekend: "Google Admits It Failed To Delete All Illegally Gathered Streetview Wifi Data"
Now you could make the argument that individually these can all be explained as missteps or simple mistakes, but put them together and you can't help but start to see a pattern that if not evil, certainly is not that good either.
So what can we do about it? Well one step you can do is to opt out of being tracked by google analytics so that google is less able to track your movements on the web. Now you can download plugins for your browser that can do this for you such as Ghostery (which I personally like a lot), but if you don't want to install a plugin these is a really simple way of doing this using the hosts file.
Modifying Your Hosts File To Disable Google Analytics
All the major consumer operating systems have a hosts file which they use as a first point of reference when looking up a web address. Only if an address is not found on this file does the computer then go out to DNS servers to try and resolve a url to an ip. We can leverage this file to block google analytics from tracking us.
As the google analytics code runs from our browsers on our computers it uses the same hostname resolution system to connect to and pass back information to the google-analytics servers. So all we need to do to block this is put in an entry in the hosts file to misdirect it.
To edit the hosts file open notepad (with administrative privileges) and open the file. Note that the hosts file does not have a file extension so when you are browsing the "etc" directory with the file open dialogue make sure that you are showing all files and not just ".txt" files.
Note: While this method tackles the google analytics tracker it does not deal with other systems which may have tracking built in such as addsense or google search itself. This is just one small step down a long road.
Update: I have discovered that windows defender has been deleting the false hosts entry file. I had to disabled it to keep my changes between reboots. Other antivirus programs may do the same.
Yes I Am A Hypocrite
Finally one word about my own website. Yes I am a hypocrite. Anyone who has a bit of tech savvy (basically anyone who is reading this) can see from my source code that I actually have google analytics code installed on this site at the time of writing this entry.
I do have plans to replace it my own analytics system which will read from my server logs but at the moment I don't have time to finish it. So for the time being I'm keeping it as does provide me with some useful information, but hopefully not for too much longer.