Using segmentation in Google Analytics for WordPress RSS readers

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 custom segments, and there's one segment I've been aching for. I want to be able to segment RSS readers, to be able to see the different browsing behavior of new visitors versus my loyal visitors.

Getting to the point where I actually can acquire that data has been a pretty long ride. I first had to create a way to change the URL's used in RSS feeds, so I could detect this different URL, 301 redirect it to the right URL, and set a cookie while doing that. To do that I filed 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:

[code language="js"]
__utmSetVar("RSS");
[/code]

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.

12 Responses to “Using segmentation in Google Analytics for WordPress RSS readers”

  1. I'm your greatest fan now.
    :)

  2. Redirecting after setting a parameter cookie is useful for all kinds of things not just in RSS feeds.

  3. You know the only major problem with this seems to be that RSS links end up in all manner of interesting places where you happen to have syndicated your content, or where someone has used the link from the feed.

  4. Sounds very great. This, and the ability to add the ?from=rss to over links withing posts (internal links / all links)

  5. I will keep conversation here

    Ok next stage :)

    For external links can your add ?source=permalink

    I want people to be able to see any traffic they receive from me, even if I can't track it myself without using redirects.

  6. Not quite the same

    If people are looking at their stats and see that they have 50 page views on

    http://yoast.com/using-segmentation-in-google-analytics-for-wordpress-rss-readers/?source=http://andybeard.eu/post-about -plugin

    They will be able to see that whilst I only send 10 visitors from my blog, I send a lot more from RSS

    It could also just be ?source=andybeard if that plays better with Analytics for conversion tracking

  7. That is an interesting article. In our experience website owners find it difficult to understand visitor behaviour even with good systems such as Google Analytics.

    We have recently come across an excellent piece of software that not only allows them to monitor individual user behaviour in real time, but also facilitates direct engagement between visitor and user. This has been increasing conversions by an average of 15% in the websites we have implemented it in.

    It seems that the individualised data gives a more enlightening perspective.

Comments closed, if you feel you have something to say:
drop me a line.

1 Trackbacks to “Using segmentation in Google Analytics for WordPress RSS readers”