Fresh Blurbs

Drupal: Who Is Subscribed to My RSS Feed?

The RSS feed subscribers are the most valuable users of your website. Those are the loyal customers, the true audience of your website. You do want to know how many of those you have and who they are.

Unfortunately, to my knowledge, Drupal does not currently have a good module to track RSS Feed subscriptions. It is not an easy module to write, either because identifying unique subscriptions is non-trivial problem.

In any case, there is http://www.feedburner.com and we could use its kind services. Linking directly to FeedBurner is not such a great idea. though. First, you may already have subscribers and you want them to be tracked, as well. Secondly, if FeedBurner suddenly goes south you do not want to lose all your subscriptions and - you may not want to change http://www.example.com/rss.xml in three places in a Drupal template.

So, what to do? If you have access to .htaccess and mod_rewrite - you have a perfect solution. What you will do is - you will create an account with FeedBurner and temp-redirect (HTTP Status 302) your original feed URL to the FeedBurner one. Sounds easy, eh?

But, wait... If you redirect example.com/rss.xml to FeedBurner, how will FeedBurner itself be able to fetch your RSS to republish later? Well, are not we lucky that Drupal allows us to create URL aliases? Let's say you create a new alias like: fbrssfeed pointing to rss.xml (note: do not create an alias like "fbrss.xml" - it still contains "rss.xml" string and things will break).

Once you verify that feed is accessible from http://www.example.com/fbrssfeed and indicate it as the feed URL in FeedBurner, open the main .htaccess file for editing and put the following somewhere in the existing rewrites:

   # Let FeedBurner Process the main RSS feeds
   RewriteCond %{HTTP_HOST} ^www\.example\.com$
   RewriteRule rss.xml http://feeds\.feedburner\.com/YourFeedBurnerID [R=302,L]
   RewriteCond %{HTTP_HOST} ^www\.example\.com$
   RewriteRule node/feed http://feeds\.feedburner\.com/YourFeedBurnerID [R=302,L]

This will solve a big part of the problem. Unfortunately, it will still not solve the problem with other RSS feeds on your website, most importantly - tag feeds, but well -it's better than nothing.

comments powered by Disqus