Q - How can I count the unique subscribers to my website's RSS feed?
A - Use use PHP to find out via accesslog ...

Create block with the following code in it:

<?php
$rssreaders
= db_fetch_array(db_query("SELECT COUNT(DISTINCT(hostname)) AS hostname FROM {accesslog} WHERE path LIKE '%/feed' OR path LIKE 'rss.xml'"));
?>

<p>Currently we have <b><?php print $rssreaders['hostname']; ?></b> RSS subscribers now.</p>

Then place on a relevant page and restrict the view to webmaster/admin role

[l:http://www.polzer-sw.com/how-count-your-drupal-website-rss-subscribers further reading/credit]

Tags: 

Add new comment

Filtered HTML

  • To post pieces of code, surround them with <code>...</code> tags. For PHP code, you can use <?php ... ?>, which will also colour it based on syntax.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Strips broken/unpublished internal links from output.
  • Adds node titles to internal links found in content (as HTML "title" attribute).
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.