One of the things I've been wanting to do for a while seems to be finally nearing completion. Google Analytics allows you to segment users into a bug in WordPress' Trac, which I wrote a fix for as well, someone else improved on it, and it was committed into the WordPress core. As of WordPress 2.3, you can apply a filter to the_permalink_rss, which allows me to add ?source=rss to any URL (or &source=rss when the blog uses the default ?p= permalinks).
The next step is detecting that parameter in the URL, and 301 redirecting to the original post URL. Before doing that 301 redirect however, I drop a cookie, which lasts for 30 days, identifying the user as an RSS reader. This allows me to, in the last step, add the following code to the Google Analytics script tag when the user has that cookie:
copy to clipboard?- __utmSetVar();
__utmSetVar("RSS");
I will know if this works tomorrow, and if it does, I'll release a new version of my Google Analytics for WordPress plugin with this possibility in it. Since I can imagine other people want to identify RSS readers for other purposes, I'll release that small bit of code as a single plugin as well.
Suggest a Correction
Found an error or have a suggestion? Let us know and we'll review it.





No comments yet. Be the first to comment!