Month: September 2009
links for 2009-09-16
Standard-
130 icons for iPhone applications
Designed and carefully optimized for use on toolbars and tab bars in iPhone apps, they're also perfect for Android apps, websites, t-shirts, tattoos and more.
Click Tracking with jQuery
StandardGenerally I use only Google Analytics for the stats of my web apps, but for one of my current projects (Bröllopia – sökmotorn för ditt bröllop – a swedish wedding site) I needed a bit more. I wanted to have detailed statistics for links leading to other sites to use these stats in the app itself. One way of doing this is of course to make all these links go to a page on my site and then when this page loads I record all the stats I want and then redirects to the external site, for example the link www.digitalistic.com/tracker.php?id=123 loads tracker.php and logs a click on the link with the id “123” (this id needs to be mapped to a link in the database) and then forwards to www.webhostninja.com. The link on my site would then look like this:
<a href='http://www.digitalistic.com/tracker.php?id=123'>WebHostNinja</a>
The problems with this is that it is slow (one more page load) and that the link the user sees does not lead to the page, ie the link text “WebHostNinja” and then the user expects the link to be something like “http://www.webhostninja.com” and nothing else. I don’t like this from a usability point of view. Not that I have any evidence for it, but I suspect that relevant outgoing links help the sites Google juice. Definitly it helps the Page Rank of the site I link to, and why should I not help them?
My solution is to use some jQuery magic. Download and install jQuery (btw, if you like jQuery, then take a look at the fantastic jQuery tools). Then add the class “track_this_link” to each link tag that you want to track as well as give each link tag an unique id (so you can track which link is which). The href attribute should point to the external site directly and not to some internal page. The link above would now look like this:
<a href='http://www.webhostninja.com' id='123' class='track_this_link'>WebHostNinja</a>
Next step is to add a some javascript that adds an onClick event to all the links with the class “external_link”:
$(document).ready(function(){
$('a.track_this_link').click(function() {
$.post(http://www.digitalistic.com/tracker.php
, {id:this.id});
return true;
});
});
This means that each time an external link is clicked a post request is sent to digitalistic.com/tracker.php with a unique id for the link in question. What is left is to implement the tracker.php script so that it can handle the post and save the data you are interested in to the database in a secure and correct way. I am happy to just summarize the number of clicks per link on a daily basis, but if you want to save detailed data for each click.
Do you have a better solution to this problem? Let me know!
Digitalistic.com 10 years old
StandardToday, it is exactly 10 years since I bought the domain digitalistic.com. It was September 13th 1999 when I registered the domain, before that I was a domain virigin. For most of the time it has been a really bad web site to market my consulting skills, that it was bad didn’t really matter since I had employment for most of the time anyway. For years the only reason I kept the domain was to have my own private email address and not use my work email or hotmail for my private stuff (yes, this was BEFORE GMail, it was that long ago).
There have been versions in Swedish, Spanish and English (even a breif French one) depending on where in the world I were at any given moment and the designs have varied quite a lot, as you can see below. A few years ago I started blogging and since then digitalistic.com has been a perfectly OK blog. Here’s a look back at old digitalistic.com designs…
1999 – 2002
Not much to say… it was one of my first web pages and I have learned a lot since then. At least I didn’t have a spinning @ sign or any applets on the page!
2002 – early 2006
Here’s the Spanish version of the second generation of digitalistic.com. I still use the logo from back then, even if the colours have changed (thanks Kemie for the great logo!).
2006 – early 2008
Then the blogging started…
(Both Pownce and Popfly that I had invites to back then are not dead – RIP Pownce!)
2008 – 20??
You are looking at it! (or if you are reading the RSS feed, you could be looking at www.digitalistic.com)
I have no plans to let digitalistic.com go and it will be my main domain for quite some time. It will be cool to see how it develops during the next 10 years (assuming we still use domains in 10 years that is).
links for 2009-09-09
Standard-
We’ll be touching on various topics, including the basic setup, URL routing, scripted file uploads, ways to lower your and control your Amazon bill and much more.