feelin’ good

Drupal: The Problem with FeedBurner

Most of us bloggers use FeedBurner to track the behavior of our feed subscribers. However, we are often not able to track ALL of our feed subscribers, because only a portion of them actually click on our FeedBurner icon to subscribe — the rest subscribes via an RSS reader, which does not go through FeedBurner.

The way an RSS reader works is that it picks up whatever URL that is contained in our page’s <link rel="alternate" ...> tag, and subscribes to it. This tag is automatically generated by WordPress, Drupal, or whatever CMS we’re using, so the URL it contains is the native feed of the site, not of FeedBurner. (Thanks to @pruet for bringing it to my attention.)

For Drupal, the way I fixed this is by removing the <link rel="alternate" ...> tag altogether, so that to subscribe to my site, users will be forced to click on the FeedBurner icon only. There are obviously better ways, but I was lazy, so here’s my quick and dirty fix for Drupal 6.2:

  1. In my Drupal site, the native RSS feeds come from two modules: Blog and Taxonomy. Neither the core nor the two modules provide an administrator option for enabling/disabling these feeds. (Maybe I was stupid, so let me know if it actually exists.) So we have to hack the source code.
  2. The core function that has the job of generating feeds is the function drupal_add_feed() in includes/common.inc. This function is called on by blog_page_user() and blog_page_last() of the Blog module, and by taxonomy_term_page() of the Taxonomy module.
  3. Being the lazy me, I went straight to the boss, the function drupal_add_feed() in includes/common.inc, and comment out the following:
    /* hack by mameou
    drupal_add_link(array('rel' => 'alternate',
       'type' => 'application/rss+xml',
       'title' => $title,
       'href' => $url));

The native feeds disappeared from all pages of my Drupal site, which is what I want.

To make the RSS reader automatically pick up the feed from FeedBurner, add this between <head> and </head> of page:

<link rel="alternate" type="application/rss+xml" title="Your Site's Title" href="Your Site's URL" />

That’s it! Let me know if you have got the proper way figured out.


One response

  1. You should use FeedBurner module instead. There is no official version for Drupal 6.x yet but @wiennat made an usable port at #802818.

    May 18, 2008 at 7:24 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s