Visit Twellow.com
Popular » Can't Buy The Top Copycat Spammers Online Obstacles Crimes On YouTube eBay Fair Trade eBay Feedback
Directory Listings » Blogs Conferences Forums Software Tutorials Submit Site

Segmentation in Google Analytics for WordPress 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:

  1. __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.

Comments

Digg This! StumbleUpon This!
AddThis Social Bookmark Widget

About the author:
Joost de Valk is a Dutch SEO who works as Search Strategist at Onetomarket, a European online marketing agency. Among the clients whom he advises about search engine marketing are the airline KLM, one of the biggest Dutch publishers Wegener, and Amadeus, a leading ICT company in the travel industry.

In his spare time, Joost is a committer in the WebKit open source project, maintains css3.info, the best online resource about CSS3, blogs about SEO, WordPress and webdevelopment on his SEO blog and develops WordPress themes and plugins in his company AlthA Webdesign.
Subscribe to WebProNews


Send me relevant info