A better way of tracking feed subcribes

RSS Icon in Location BarI use FeedBurner, just like anyone else, to track my subscribers. One thing I really like to measure too though, is the number of feed subscribes, as in the act of subscribing. Now you can simply add onclick handlers for Google Analytics or any other stats package to all your feed links, but that means leaving one big gap: people can click on the RSS icon in their location bar, and there's nothing you can do to track that. Until now!

The problem is that you can't add an onclick handler on that icon, because it's in the browsers UI, and not on your page. The browser grabs the info for that icon from the link rel="alternate" link in the head section of your HTML, you can even have multiple rel's like that, and then the browser will show multiple options.

The solution is actually quite simple, you change the link in that link meta tag to another page. On that page you install a javascript tracker, with which you create a pageview or event, and then you do a javascript redirect to the original feed URL. The code doing that on my blog looks like this:

Update:  Niels convinced me with his comment below that this is not the way to go... I'll have to think of another method.

[code language="html"]




Thanks for subscribing to my feed!

Redirecting you to the feed URL! If that doesn't work, click here.


[/code]

Make sure you don't forget to add the noindex meta tag, as there's no use for this page to show up in the search results, and the text, in case people have prevented their browser from following javascript redirects.

There's one known issue with this way of tracking, auto detection of feeds, which some RSS readers etc can do, is now broken. I'll be working on a way to fix that.

8 Responses to “A better way of tracking feed subcribes”

  1. Something I've tried before is to cloak the page so that it 301 redirects if the user agent isn't Firefox or IE. That way it doesn't break the auto detection of feeds.

  2. I'm not sure I like this solution.

    You are basically lying to the browser about the content type. You are telling the browser it should expect application/rss+xml at the alternative URL, but it's plain HTML instead.

    I can actually lead to the inability to subscribe to your feed. For example try subscribing to your feed from Safari, it won't work and Safari will show an error message instead.. Also external feed readers usually register themself at the operating system for the application/rss+xml type and fetch the alternative URL themselves. If they don't understand HTML and Javascript - and I doubt any of them do - those feedreaders will never reach your actual feed URL.

  3. You could do it with a 301 redirect but then your tracking software should support server-side tracking.

  4. I Think its time for a new blog called "The best way of tracking feed subcribes" ;)

  5. You could include a serverside http request to your statistics software/service for every request to the /feed/ url before redirecting to the Feedburner url. You'll lose the ip address info, but you can echo other info from the original request such as browser type in the header sent by your script.

    Peter van der Graaf has written about similar setups:
    http://www.vdgraaf.info/google-analytics-without-javascript.html

    You would need to filter on user agent however to get the browser requests and not the Desktop feed readers/bots.
    What's more: Mozilla/Flock often prefetch feed urls in the autodiscovery info, without the user actually subscribing. So you might want to measure subscriptions by measuring how many people follow the "path" (1 - request to feed url) (2 - request to image included in the html)

  6. Javascript example code is not properly escaped in this blog entry so it actualy redirects to your RSS feed on feedburner ;) In order to read this entry I have to disable Javascript in my browser.

Comments closed, if you feel you have something to say:
drop me a line.

2 Trackbacks to “A better way of tracking feed subcribes”