Top Content Powered by Google Analytics
I found myself contemplating writing a full blown content rating and reporting system for a simple blog just to get an accurate representation of the popularity of posts. I wanted it to be based on unique hits but I didn't want to deal with the data and the requests that come along with such a system for such a trivial usage.
Obviously there are plenty of options out there but for a simple remote solution, I normally fall back on Google Analytics for its ease of use and Adwords integration. It's Google, they have an API for everything right? Wrong.
What do I want to do exactly?
A simple top posts feed that is powered by a Google Analytics "Top Content" report and updated automatically on a daily or weekly basis.
Options?
Well, you can schedule a report of Top Content to be sent out in XML, CSV, etc via email on intervals... so there some solutions out there (http://blogoscoped.com/archive/2008-01-17-n73.html) that involve sending the report to a scripted email address or a Google Group so that it can have a parsable public URL, but I was looking for something a bit simpler.
Rugalytics (written by Rob McKinnon, rock on!) - Exactly what I was looking for. Basically mechanizes the login to Google and handles the navigation through Google Analytics in Ruby library format. A few lines of code and a quick entry to my crontab and I threw out my manual Google Analytics CSV uploader/parser.
1 profile.content_drilldown_report(:url => "/path_to_blog/posts/")
is the report I am using which gives me all the relevant information about each post over a given time period.
Conclusion
There are other options, but of these I went with the latter choice. Obviously changes to the Google Analytics formatting could break it, but it is exactly what I wanted for a small nonchalant application.
Options:
Save This
|
Share
Viewed 1 times
Published 3 months ago
By Cary Dunn
From Resource
Elc Tech Blog in lists:
Best Ruby on Rails Blogs