Using bit.ly (trackable URL shortener) with Twitter Tools in Wordpress

20 Apr 2009
1 Comment »

bitly screen grabI wrote in this article about using Twitter Tools with tweetburner (the twurl.nl URL shortener). I was pretty happy with this solution as it allowed me to measure (to a degree) the traffic interest in various blog posts I put up, be it for WiAU, Cognicology or this blog. It wasn’t the perfect solution however, as the version of Twitter Tools the modified update used was a little old and I always have that little nagging feeling that doesn’t go away when using modded or hacked software.

The deal-breaker for me came when I read an article reviewing the large number of URL shortener services out there. It turns out that tweetburner uses 303 redirection as opposed to 301, which is not ideal for many reasons (see this article for the reasons why, thanks to @problogger).

In the time between my first article and this discovery about the redirection, I had read in the Twitter Tools readme that the developer had created a hook in the code to allow the plugging in of a URL shortening service – the appropriate plugin for wordpress simply needed to be developed, packaged and installed.

Unfortunately, I couldn’t find a decent package for a URL shortening service using the API calls required to work with Twitter Tools on the wordpress site. After a bit of a search, I found this code snippet that implemented the bit.ly shortening service. This got me excited, because the bit.ly service was on the shortlist of services that I wanted a plugin for. It is one of the shorter URLs generated (14 chars), has some impressive usage tracking and can link multiple twitter accounts to the one bit.ly account. Ace!

I’ve taken the code snippet and packaged it into a ZIP file for upload into the Wordpress plugin manager. You can download it here.

Installing is relatively simple.

1. install and activate the Twitter Tools plugin.

2. install the Bit.ly plugin from this site.

3. BEFORE you activate the Bit.ly plugin, use the inbuilt plugin code editor for wordpress, and change the $login and $api_key values to your bit.ly account login and API key. It is in the first section of code and looks like this (change the bits in red):

function tweet_track($long_url) {
	$login = 'YOUR_LOGIN';
	$api_key = 'YOUR_API_KEY';

4. Activate the plugin.

If all is well, you should now be able to to have post submitting to Twitter, but using the bit.ly service as the URL shortener.

DISCLAIMER: This post itself is also doubling as my testing post for this method. I may or may not be embarrassed by the results.

——

UPDATE (20/4/09 ; 2.5 minutes later): It seems the plugin installation was a success!
Below is the text from my twitter status update:

New blog post: Using bit.ly (trackable URL shortener) with Twitter Tools in Wordpress http://bit.ly/bRa58

Link tracking in Twitter with wordpress support

04 Feb 2009
No Comments »

I’ve been reading up a fair bit on social media advertising. I’ve been using twitter as a way to promote my WiFi Mapping project, WiFi in Australia. WiFi in Australia has been up for a little over two weeks now. I started a facebook group at the start of the project, and actively sent invites to people that I knew. I also started a Twitter account (wifi_australia). I only started actively started sending invites to people on Monday.

It is now Wednesday, and already 40% of my total traffic to my site has originated from Twitter and the number of people following my wifi twitter account increase everyday. What I wanted to know is which linking posts were attracting users to my site.

The use of URL-shortening services is popular on micro-blogging sites such as twitter, where character-efficiency is important. There are many services that do this, but some are starting to provide link-through statistics.

TweetBurner allows users to track the number of clicks for a given shortened URL, and users can display a summary of shortened URLs and their clickthrough count when logged in to their service.

TweetBurner is also supported by popular twitter apps such as TweetDeck (twurl). I have also found a modified version of Twitter Tools by Rebelic.com that supports TweetBurner URL-shortening. Twitter Tools is a popular plugin for Wordpress, that will notify a configured Twitter account of new blog posts, and link to the permalink. Now, with a mixture of TweetBurner and Twitter Tools (TweetBurner edition), I can track the clickthrough count for my blog posts!

A promising new URL-shortener and conversion tracker is Twitclicks. Twitclicks give a much deeper analysis of the click-through events. For a given link, it will show you the total number of clicks, the percentage of your followers that have clicked and a breakdown of stats on the user including browser, OS, geographic location, click source (website or external app) and even screen resolution.

Twitclicks is by far the most comprehensive click-through service I have seen. Unfortunately it is not yet supported by many apps (read: my favourite twitter app, TweetDeck) and I am yet to find a Wordpress plugin for it.. but I am sure these will come soon!

TweetBurner: http://tweetburner.com/

TweetClicks: http://www.twitclicks.com/

Twitter Tools (TweetBurner.com edition): http://rebelic.nl/tweetburnercom-plugin/