Friday, April 07, 2006

Tracking referrers in a hosted blog

I got curious about where people come from to this blog (not that I have swarms of visitors -- I should have probably said "curious IF people come to this blog").

Since this is hosted by Blogger.com and I don't have access to the server logs I used this simple webbug -- added this javascript one-liner into the template:
<script language="javascript" type="text/javascript"><!--//
if(document.referrer) {
document.write('<img src="http://ejelta.com/images/myblog.gif?ref=' +
escape(document.referrer)+
'" width="1" height="1" alt=""/>');
}
//--></script>

It sends a request to the server where I do have control over server logs, so I can grep for myblog.gif and see the referrers.

Thought I'd post this in case it may be useful for somebody else.

0 Comments:

Post a Comment

<< Home