Monday, November 19, 2007

How to exclude your own visits from Google Analytics and ClustrMaps

After a 5 minute Google (re)search I found a few ways to exclude my own visits to my sites/blog from the Google Analytics and ClustrMaps reports.

Google recommends two ways of doing this:

  • Creating a filter that excludes your IP address from the reports
  • Installing a cookie in your browser and creating a filter that excludes your visits from the reports

I don't find the first option very useful because I don't use static IP addresses.

As for the other option, I really didn't try that. Google doesn't explain very well how to do it and I didn't have the patience to explore that option.

Another downside of both of these options is that they require that you edit your html. OK, that's not really a problem but when you're managing a blog, you don't want to mess with your HTML too much.

I found an easier approach in here:

Use AdBlock Plus to block communication with Google Analytics and ClustrMaps.

These are the addresses I had to block:

  • http://www.google-analytics.com/urchin.js
  • http://www3.clustrmaps.com/counter/index2.php?url=http://(enter your address here)

Don't forget to disable the Collapse blocked elements option in AdBlock. If you don't disable that option, you won't be able to see the link to you ClustrMap (Adblock simply doesn't show anything).

[Update]

Ok, there's a problem with the approach I described for Google Analytics: It will block the analytics scripts of other sites you open (including your friends' blogs).

To fix this you have to... well, change the HTML of your site :-D

In your HTML find the following tag:

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">

and replace with:

<script src="http://www.google-analytics.com/urchin.js#url=http://(replace with your site url)" type="text/javascript">

I added the #url=http:(replace with your site url) which in fact doesn't do anything when getting the script from the server but allows us to setup AdBlock to block this URL.

Next, you have to setup AdBlock to block only http://www.google-analytics.com/urchin.js#url=http://(replace with your site url) instead of the late http://www.google-analytics.com/urchin.js.

Thursday, November 8, 2007

input image objects not found in form.elements

Imagine you write the following javascript sentence in an html page:

self.document.forms[0].elements

That will give you all the elements inside the first form (forms[0]) in the current page, right? Well, no. For some reason, if you have an input of type image (<input type="image">) in the form, that element will not be in the forms[0].elements object.

Every other input (button, text, select, submit, ...) will be in the elements object, but do not expect to find image type inputs. I've tried that in IE and Firefox unsuccessfully.

(If you don't know what an input of type image is, well it's behaviour is the same as the submit inputs but instead of a button, the user is presented with an image.)

So, how do we solve this? Well, instead of using:

self.document.forms[0].elements

we have to use the following:

self.document.all

Of course, that way, you will get a list of all the elements in the current page instead of all the elements in a form but you will find the inputs of type image in there, for certain.

Wednesday, November 7, 2007

Buying a new PC

I will be buying a new desktop PC soon, so I'm starting to study what components are out there in the moment, their features, prices, etc.

This is the (short) list of the sites I'm reading to get this kind of information. I will be updating the list as I get to know more interesting sites: