nxt's place

Other

Tracking organic ranking with google analytics

by on Oct.11, 2010, under Other

If you want to track your rank in the organic search results you can do the following:
First we need to check the referrer and see if it contains the necessary bits.

1
2
3
4
var rank= /^(?:http|https)\:\/\/(?:.+\.)*google\..+(?:\?|\&)cd\=(\d+)/.exec(document.referrer || '');
if(match) {
  alert('position = ' + rank[1]);
}

The next thing we want to do is modify our analytics tracker code to include a custom variable:

1
2
3
4
5
6
7
var rank= /^(?:http|https)\:\/\/(?:.+\.)*google\..+(?:\?|\&)cd\=(\d+)/.exec(document.referrer || '');
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXX-X']);
if(rank) {
  _gaq.push(['_setCustomVar',1,'Google_Ranking',rank[1],2]);
}
_gaq.push(['_trackPageview']);

We’ve set the custom variable to slot 1, and the last number two means that we scope it to the session.

Finally you’ll want to wrap it up in a closure to prevent polluting the global scope:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
var _gaq = _gaq || [];
(function() {
  var rank= /^(?:http|https)\:\/\/(?:.+\.)*google\..+(?:\?|\&)cd\=(\d+)/.exec(document.referrer || '');
  _gaq.push(['_setAccount', 'UA-XXXXXX-X']);
  if(rank) {
    _gaq.push(['_setCustomVar',1,'Google_Ranking',rank[1],2]);
  }
  _gaq.push(['_trackPageview']);
 
  var ga = document.createElement('script'); ga.type = 'text/javascript'; 
  ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  var s = document.getElementsByTagName('script')[0];
  s.parentNode.insertBefore(ga, s);
})();

You can view your new statistics using the Advanced segmentation feature of Google analytics, but keep in mind that it’s only possible to harvest data from the links that are clicked on.

Comments Off on Tracking organic ranking with google analytics :, , more...

IPv6

by on Sep.15, 2008, under Other

I decided it was time to start experimenting with IPv6.
I started with go6.net, so I created an account and installed the software for the tunnel on my linux machine.
apt-get install tspc
add the account info to the config file and you're ready to go. It worked instantly. However it was a little slow (200kB/s and ping times up to 300ms) but that is probably related to the distance between our locations.

So next I tried Hurricaine Electric which have an endpoint at the AMS-IX so that should give me better speed, or at least better ping times. They offer no custom software but instead use protocol 41. Unfortunately it seems that my linksys BEFW11S4 router doesn't let that traffic through (not even when I place my machine in the DMZ) so I looked on.

I finally ended at SixXS which also has several tunnel endpoints in the Netherlands and offer an UDP based protocol that is capable to pass through NAT.  Their software works I get very good speeds and ping times here. The only downside I could find is that you'll have to wait for a week before you can request a /48 subnet, but this should'nt be a big problem, just be patient and besides it gives you the time to figure out how you want to configure your network.
Their service works very good and I'm glad I signed up there. 

Now all I need to do is find a router that is capable of passing protocol 41 and convert my ayiya based tunnel to one that provides less overhead.

Comments Off on IPv6 :, more...

IE8: opt-out mime sniffing

by on Jul.22, 2008, under Other

According to a recent blog entry on msdn  Microsoft has finally decided to fix a very annoying 'feature' of internet explorer. Mime-sniffing.

 It always irritated me that when I specified a content-type for a web page, Internet Explorer would just look at the content and say: "your wrong" and renders the page the way it thinks you intended.
If I give a html page text/plain as content-type I intend to let it show the source, not render it as html because if I wanted that I would have given it text/html as content-type.

At least in IE8 they allow us to disable the mime sniffing by appending ";authoritative=true" to the content-type header. This way it won't hurt other browsers and we are still able to provide the mime type ourselves.

Comments Off on IE8: opt-out mime sniffing :, , , more...

Wireless

by on Dec.30, 2005, under Other

I recently bought the 3com OfficeConnect travel router to have wireless internet whenever I'm at my parents.
I'm very pleased to see that – despite some reviews I've read – the range is very good.
I chose this one because it can function as an accesspoint, router or
client. The client mode can be usefull when I'm with other people since
my laptop (acer travelmate 800LCi) only has 11b, so I can get some
higher speeds with this thing. It would have been nice though if it
could optionally be powered by usb so that I wouldn't need to carry the
adapter everywhere I go.

Comments Off on Wireless :, , , , more...

Apache 2.2.0

by on Dec.10, 2005, under Other

I wanted to upgrade to Apache 2.2.0 on my windows server, but because
of some changes in the APR library all modules need to be recompiled.
In my case the most important ones are mod_ssl and the subversion
modules.
It seems very difficult to compile the two with visual studio 2003 without compile errors 🙁
but I keep trying… I now have only two compile errors left to resolve.

Comments Off on Apache 2.2.0 :, , more...

linux

by on Jul.12, 2005, under Other

I've finally installed Linux on my notebook. Which distribution? touch choice…
Eventually it came down to the difference in package management systems
and the two systems I liked most are 'apt' which is found in debian
based distributions and 'emerge' from the gentoo distribution. I went
for gentoo mostly because I feel that it gives me more controll over
what I want to install. I had my thumbs crossed because I really wanted
to use the packages cd (you really don't want to wait untill KDE is
compiled before you can use your system). I must have f*cked up
somewhere in the process, because I only managed to install KDE from
the packages disc (maybe I should have disconnected the ethernet
cable?).
However overall I'm satisfied with the time the installation took, and
it may be worth mentioning that the gentoo manual is very detailled and
complete. I hope that I can take a peek at Sun's project Looking Glass once I figured out which ATI drivers I should use.

Comments Off on linux :, , , more...

rss / nntp

by on Jul.06, 2005, under Other

nntp//rss is an
application that contains an NNTP server and allows you to represent
RSS feeds as newsgroups so you can read the feeds with your favorite
client (e.g. Outlook Express, Thunderbird, ..)
It comes with an web interface for administration & monitoring purposes

Comments Off on rss / nntp :, , more...

raxco

by on Apr.07, 2005, under Other

I've found an intresting line in the changelog of Raxco PerfectDisk 7.00.042

Corrected a bug in the boot time defragmentation. PerfectDisk records
the current time on shutdown and compares it to the system time at
reboot. On Windows XP, Service Pack 2, the system time at reboot can be
earlier then the system time at shutdown. Raxco was unaware that Microsoft was able to travel back in time.

Comments Off on raxco :, , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...