Category feed subscription script for Blogger

rss blogger
When I first started writing my blog I managed to put a feed. Not long after I was happy that visitors actually subscribed to my posts. Later the feed statistics showed old subscribers withdrawal, substituted by new fresh subscriptions. This way the overall subscribers count stayed the same and that was a problem.

Since then this has been a mystery to me until I thought more on the subject: The posts were ranging from computers to garden, aquarium fish, fitness etc... - all unrelated - so that might be the reason behind user's opt out - the next post was not always of their interest.

That's why I've implemented this handy script that you can place at the bottom of your posts to encourage user's subscription to a specific feed category. It is based on your post labels - so if you've already labeled your posts then feed subscription links will show automatically.

Demo: You can see it working at the bottom of this post.

Installation:
1. Open your Blogger HTML template
2. Check Expand Widget Templates
3. Replace 'your_blog_address.com' with your actual blog address and paste the following code below your <data:post.title> tag:

<b:if cond='data:post.labels'>
<div style='background:orange; padding:1em;'>
Free subscription to new articles from category:
<b:loop values='data:post.labels' var='label'>
<a expr:href='"http://your_blog_address.com/feeds/posts/default/-/" + data:label.name + "?alt=rss"' rel='nofollow' style='color:brown;'> <data:label.name/></a><b:if cond='data:label.isLast != "true"'>,</b:if>
</b:loop>
</div>
</b:if>
How to track feed conversion rate
If you wish to track your feed subscriptions just use Google Analytics to create a Goal.
Fill in:

Goal URL: http://your_website.com/feed
Goal name: Feed label subscription
Then edit the subscription link and add the following tracking JavaScript code
onclick='javascript:urchinTracker("/feed")'
example:

<a onclick='javascript:urchinTracker("/feed")' href="http://yourwebsite.com/feeds/posts/default/-/your_label?alt=rss">Feed label subscription</a>

That's it. When a visitor subscribes you will see it from the Goals report as accomplished goal. Even more interesting is the Reverse Goal Path report that will show you the actual navigation and pages from which visitor's subscribed.

bonus:
Most popular articles script based on comments count
<script type="text/javascript">
function pipeCallback(obj) {
document.write('<ul style="text-transform: capitalize;"><li><strong>Popular Posts:</strong></li>');
var i;
for (i = 0; i < obj.count ; i++)
{
var href = "'" + obj.value.items[i].link + "'";
var item = "<li>" + "<a href=" + href + ">" + obj.value.items[i].title + "</a> </li>";
document.write(item);
}
document.write('</ul>');
}
</script>
<script src="http://pipes.yahoo.com/pipes/pipe.run?_render=json&_callback=pipeCallback&_id=28a6afad7c6ba1288c1b738277e42385&url=http%3A%2F%2Fyour_blog_name.blogspot.com&num=10" type="text/javascript"></script>
just replace the parameter your_blog_name, create a new HTML/Javascript widget from the Blogger layout the paste the code there.
Cheers! by Nevyan Neykov



0 коментара:

Post a Comment