Is it possible to provide a 'do nothing' web page so that one can set references to google.analytics.com for example to go to a page on localhost that does nothing?
I've no particular hang-up about google analytics except tha it's so slow. When accessing the Screwfix site for example it spends much more time on Google analytics than it does telling me what I want to know.
If I just put an entry like 127.0.0.1 google.analytics.com
In my /etc/hosts file it will presumably get lots of 'page not found' errors, probably OK but I was wondering if there was a neater way.
Hi Chris,
If I understand correctly, you're looking for a way to block Google Analytics?
You can block GA (and hundreds of others) with Ghostery - http://www.ghostery.com/
HTH
On Mon, Sep 16, 2013 at 11:03 AM, Chris Green cl@isbd.net wrote:
Is it possible to provide a 'do nothing' web page so that one can set references to google.analytics.com for example to go to a page on localhost that does nothing?
I've no particular hang-up about google analytics except tha it's so slow. When accessing the Screwfix site for example it spends much more time on Google analytics than it does telling me what I want to know.
If I just put an entry like 127.0.0.1 google.analytics.com
In my /etc/hosts file it will presumably get lots of 'page not found' errors, probably OK but I was wondering if there was a neater way.
-- Chris Green
main@lists.alug.org.uk http://www.alug.org.uk/ http://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above!
On Mon, Sep 16, 2013 at 11:07:43AM +0100, Alex Scotton wrote:
Hi Chris,
If I understand correctly, you're looking for a way to block Google Analytics?
You can block GA (and hundreds of others) with Ghostery - http://www.ghostery.com/
It's not just google analytics, and I suspect some things I don't want to see (or connect to) won't be covered by Ghostery. I'll take a look though, thanks.
On 16/09/13 11:03, Chris Green wrote:
Is it possible to provide a 'do nothing' web page so that one can set references to google.analytics.com for example to go to a page on localhost that does nothing?
/snip/
Not sure what you want to do, largely because I've never heard of Google Analytics..
I suggest you make Ixquick your default browser - Ixquick only does what you ask it to do, and offers you no pop-ups or ads.
On Mon, Sep 16, 2013 at 12:46:40PM +0100, Anthony Anson wrote:
On 16/09/13 11:03, Chris Green wrote:
Is it possible to provide a 'do nothing' web page so that one can set references to google.analytics.com for example to go to a page on localhost that does nothing?
/snip/
Not sure what you want to do, largely because I've never heard of Google Analytics..
I suggest you make Ixquick your default browser - Ixquick only does what you ask it to do, and offers you no pop-ups or ads.
Ixquick is a search engine not a browser, I do use it sometimes instead of Google. However if you watch your browser's status bar while you view web sites you will see *lots* of them use google.analytics to follow how your web brwsing goes. It's nothing to do with using Google for searches.
On 16/09/13 13:52, Chris Green wrote:
Ixquick is a search engine not a browser, I do use it sometimes instead of Google. However if you watch your browser's status bar while you view web sites you will see*lots* of them use google.analytics to follow how your web brwsing goes. It's nothing to do with using Google for searches.
In the Good Old Days [TM] Google used to be a search engine. I'd never considered using Google as a browser, but now I know it'sgetting uppity like that, it explains a lot...
On Mon, Sep 16, 2013 at 03:44:17PM +0100, Anthony Anson wrote:
On 16/09/13 13:52, Chris Green wrote:
Ixquick is a search engine not a browser, I do use it sometimes instead of Google. However if you watch your browser's status bar while you view web sites you will see*lots* of them use google.analytics to follow how your web brwsing goes. It's nothing to do with using Google for searches.
In the Good Old Days [TM] Google used to be a search engine. I'd never considered using Google as a browser, but now I know it'sgetting uppity like that, it explains a lot...
Google is a search engine, Ixquick is asearch engine.
Quite unrelated to what swarch engine you use many sites you visit will link to Google Analytics to analyse your usage.
On 16 September 2013 11:03, Chris Green cl@isbd.net wrote:
Is it possible to provide a 'do nothing' web page so that one can set references to google.analytics.com for example to go to a page on localhost that does nothing?
[..]
If I just put an entry like 127.0.0.1 google.analytics.com
That would be the first step regardless, so I would start there.
Then, assuming you have Apache (or similar) running you'd want it configured so that http[s]://localhost/ga.js returned an empty file; as far as I can tell that's all you'd need. But do note that you'd need https to work as well to do it properly.
I'd be surprised if collecting the file itself is causing a delay (nearly everyone uses it, so it'll be cached by the browser anyway); any delay will come from the code in that file "doing its thing". I have noticed apparent delays there myself too, although never bad enough to do something about it. Since the GA code should (I assume) run asynchronously it still shouldn't be having the impact it seems to, which has always made me suspect something else is the issue. I'd have thought that just the hosts file entry would be enough to prove it one way or another though.
Mark
On Mon, 16 Sep 2013 11:03:32 +0100 Chris Green cl@isbd.net allegedly wrote:
Is it possible to provide a 'do nothing' web page so that one can set references to google.analytics.com for example to go to a page on localhost that does nothing?
I've no particular hang-up about google analytics except tha it's so slow. When accessing the Screwfix site for example it spends much more time on Google analytics than it does telling me what I want to know.
If I just put an entry like 127.0.0.1 google.analytics.com
In my /etc/hosts file it will presumably get lots of 'page not found' errors, probably OK but I was wondering if there was a neater way.
I do exactly that. The hosts file on my local DNS server (running DNSMasq) is derived from Dan Pollock's file at http://someonewhocares.org/hosts/ Dan includes lots of google servers in his file.
Mick
---------------------------------------------------------------------
Mick Morgan gpg fingerprint: FC23 3338 F664 5E66 876B 72C0 0A1F E60B 5BAD D312 http://baldric.net
---------------------------------------------------------------------
On 16/09/13 15:36, mick wrote:
On Mon, 16 Sep 2013 11:03:32 +0100 Chris Green cl@isbd.net allegedly wrote:
Is it possible to provide a 'do nothing' web page so that one can set references to google.analytics.com for example to go to a page on localhost that does nothing?
[]
127.0.0.1 google.analytics.com
In my /etc/hosts file it will presumably get lots of 'page not found' errors, probably OK but I was wondering if there was a neater way.
I do exactly that. The hosts file on my local DNS server (running DNSMasq) is derived from Dan Pollock's file at http://someonewhocares.org/hosts/ Dan includes lots of google servers in his file.
Yes it's possible.
Some cryptic notes I have refer to this page as inspiration http://dcssrv1.oit.uci.edu/indiv/ehood/gems/ad-blocking.html
I have entries in my dnsmasq file like address=/DOMAIN_TO_BE_BLOCKED.com/127.0.0.1
I have Apache installed. Other lightweight webservers might be quicker/easier (lighttpd, nginx?) , but I had it installed anyway so I used it.
ports.conf has this added
NameVirtualHost 127.0.0.1:80 Listen 127.0.0.1:80
So dnsmasq redirects things to this virtualhost.
/etc/apache2/sites-available/default has this added: #From http://dcssrv1.oit.uci.edu/indiv/ehood/gems/ad-blocking.html <VirtualHost 127.0.0.1:80> DocumentRoot "/var/www/adblock" #ErrorLog logs/error-block.log ErrorLog /var/log/apache2/error.log SetEnvIf Request_URI .* no-access-log #CustomLog logs/access-block.log common env=!no-access-log CustomLog /var/log/apache2/access.log common env=!no-access-log Options FollowSymLinks RewriteEngine on RewriteRule ^(.*) /var/www/adblock/index.htm #http://www.lavluda.com/2007/07/15/how-to-enable-mod_rewrite-in-apache22-debi... </VirtualHost>
If I remember correctly, Rewite Rule changes anything and everything on 127.0.0.1 to point to /var/www/adblock/index.htm
I then have a file at /var/www/adblock/index.htm with this in it. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en-GB">
<head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <meta http-equiv="Content-Language" content="en-GB"> <meta name="GENERATOR" content="Text Editor"> <meta name="ProgId" content="Text Editor"> <meta name="AUTHOR" content="YOUR_NAME"> <meta name="rating" content="general"> <title>AdBlock</title> </head> <body> <p>AdBlock</p> </body> </html>
The above is a valid minimalist webpage with a title Adblock, displaying only the text Adblock. You can change this if you want to.
If you set this up and restart Apache, then anything that dnsmasq redirects to 127.0.0.1 will instead show "AdBlock"
NB, this will point any web access to 127.0.0.1 to this adblock page. This may break some things if you have web servers running on this page. If that causes a problem, you could instead use 127.0.0.2 (or other numbers, .3, .4, .5 etc). I'm not sure exactly where it ends, but the first few addresses in that range are private loopback addresses, not just 127.0.0.1.
I use files from http://pgl.yoyo.org/adservers for ad servers and http://www.malwaredomains.com/ for "bad" domains
I use a script to wangle these into the correct format for dnsmasq and I find it works quite well.
HTH Steve
NB this will point 127.0.0.1 to an adblock file.
On 17 September 2013 00:51, steve-ALUG@hst.me.uk wrote:
If I remember correctly, Rewite Rule changes anything and everything on 127.0.0.1 to point to /var/www/adblock/index.htm
I then have a file at /var/www/adblock/index.htm with this in it.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-GB">
<head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <meta http-equiv="Content-Language" content="en-GB"> <meta name="GENERATOR" content="Text Editor"> <meta name="ProgId" content="Text Editor"> <meta name="AUTHOR" content="YOUR_NAME"> <meta name="rating" content="general"> <title>AdBlock</title> </head> <body> <p>AdBlock</p> </body> </html>
The problem with this is that not everything is looking for valid HTML. The example of Google Analytics looking for a JavaScript file is a good one, but it's presumably possible that sometimes (eg) an image or CSS file is expected instead.
At least for when text files are expected, an empty file ("touch index.html" will create it) should be accepted as "valid" HTML/JS/CSS/etc (I know it isn't actually valid HTML but I think all browsers will accept it without complaint?) I think most browsers are OK with it as in image file too but don't quote me on that... As soon as you put content into the file you have problems.
Of-course the re-write rule could be modified to redirect to an appropriate dummy file based on the file extension, although that isn't always reliable: <img src="/blah.php" /> doesn't give the web server much of a clue as to the type of content being expected.
On 17/09/13 09:59, Mark Rogers wrote:
On 17 September 2013 00:51, steve-ALUG@hst.me.uk wrote:
If I remember correctly, Rewite Rule changes anything and everything on 127.0.0.1 to point to /var/www/adblock/index.htm
[Snip]
The problem with this is that not everything is looking for valid HTML. The example of Google Analytics looking for a JavaScript file is a good one, but it's presumably possible that sometimes (eg) an image or CSS file is expected instead.
At least for when text files are expected, an empty file ("touch index.html" will create it) should be accepted as "valid" HTML/JS/CSS/etc (I know it isn't actually valid HTML but I think all browsers will accept it without complaint?) I think most browsers are OK with it as in image file too but don't quote me on that... As soon as you put content into the file you have problems.
Of-course the re-write rule could be modified to redirect to an appropriate dummy file based on the file extension, although that isn't always reliable: <img src="/blah.php" /> doesn't give the web server much of a clue as to the type of content being expected.
Fair points. IME my solution seems to work for me. I put "Adblock" in the text purely so I could see when something was being blocked.
TBH I don't recall if I was actually already blocking Google Analytics with this approach.
If it helps, Ghostery will block many trackers, and I think there are several plug-ins for browsers which claim to block Google Analytics - e.g. the Google Analytics Opt-out Browser Add-on (currently v 0.96) for Firefox available from Google.
HTH Steve
On 17 September 2013 11:26, steve-ALUG@hst.me.uk wrote:
If it helps, Ghostery will block many trackers, and I think there are several plug-ins for browsers which claim to block Google Analytics - e.g. the Google Analytics Opt-out Browser Add-on (currently v 0.96) for Firefox available from Google.
Ghostery, despite being something I have known about for ages, is something I have only just looked at because of this thread. Interesting and useful tool, even though in general I'm the kind of person who (for the most part) isn't bothered about the kind of tracking that GA and the like indulge in.
On 17/09/13 13:50, Mark Rogers wrote:
On 17 September 2013 11:26, steve-ALUG@hst.me.uk wrote:
If it helps, Ghostery will block many trackers, and I think there are several plug-ins for browsers which claim to block Google Analytics - e.g. the Google Analytics Opt-out Browser Add-on (currently v 0.96) for Firefox available from Google.
Ghostery, despite being something I have known about for ages, is something I have only just looked at because of this thread. Interesting and useful tool, even though in general I'm the kind of person who (for the most part) isn't bothered about the kind of tracking that GA and the like indulge in.
I have been using ghostery for some time now. I installed it because of the time taken by some sites to perform all of their tracking (as many as 20 trackers on some sites). I have found that browsing is much faster with it activated than not but I have also found some sites that refuse to function if it is active.
Being able to turn it on and off with a click or two is, I would think, easier than modifying the redirection to a null file.
YMMV.
Nev
On 17/09/13 20:16, nev young wrote:
On 17/09/13 13:50, Mark Rogers wrote:
On 17 September 2013 11:26, steve-ALUG@hst.me.uk wrote:
If it helps, Ghostery will block many trackers, and I think there are several plug-ins for browsers which claim to block Google Analytics - e.g. the Google Analytics Opt-out Browser Add-on (currently v 0.96) for Firefox available from Google.
Ghostery, despite being something I have known about for ages, is something I have only just looked at because of this thread. Interesting and useful tool, even though in general I'm the kind of person who (for the most part) isn't bothered about the kind of tracking that GA and the like indulge in.
I have been using ghostery for some time now. I installed it because of the time taken by some sites to perform all of their tracking (as many as 20 trackers on some sites). I have found that browsing is much faster with it activated than not but I have also found some sites that refuse to function if it is active.
Being able to turn it on and off with a click or two is, I would think, easier than modifying the redirection to a null file.
YMMV.
Yes & No I can turn Ghostery off with a couple of clicks. I have a script to disable & enable null redirection in a handful of clicks. Although, to be fair, enabling takes longer as it simplistic downloads and recreates the blocking file and both restart dnsmasq. I suppose both take longer than changing blocking status on Ghostery.
Steve