Google Analytics plugin for Ruby on Rails released
posted: December 13th, 2007 · by: Sven
I’ve just released a first version of the Google Analytics plugin for Ruby on Rails that I’ve done in the course of the offer to build custom plugins for Mephisto users.
You can grab the plugin and read more about it here: Ruby on Rails Plugin: Google Analytics (blue egg edition)
Eran Ben Sabat was the first to contact me about this offer and suggested that I could write a Google Analytics plugin which he was interested in.
By now there’s another interesting request by Thilo Thamm who asked for a plugin for allowing users to add blog posts. This sounds like another great idea for a useful plugin and I plan to tackle this one next.
I was totally thrilled how much fun it was to work with both Liz and Eran Ben Sabat on their plugins. So my offer still stands. If you have an idea for a nice plugin, don’t hesitate to drop me a note.
Carl Pelletier said January 12th, 2008 at 08:32 PM ¶
Hi Sven, I try your google analytics plugins for Mephisto or Rails with the latest version of Mephisto and I get errors when the parsing of the page occur.
Here the error:
google_analytics.rb:60: Illegal character ‘&’ in raw string “Hosting Rails - Ruby on Rails Hosting - Robust & Affordable Plans”
This line is def addurchintrackers(string) return string unless GoogleAnalytics.enabled? doc = REXML::Document.new(string) REXML::XPath.each(doc, “//a”) do |node| string = parseurchintracker(string, node) end string end
Thanks for any support or help! You did a great job!
Sven said January 15th, 2008 at 01:59 PM ¶
Hi Carl,
hmmmm, … this might happen because REXML expects this string to be valid XML? Dunno. Maybe I should use something else here to parse the link. I’ll have a look at that.
In the meantime you might be able to fix this by using an HTML & char instead of the plain &.
Please let me know if that doesn’t work either!
daniel said March 13th, 2008 at 12:14 PM ¶
…. i have a problem when i using it with will_paginate…
i have two paginate bar on one page(top and bottom)
the code here: (top)
(bottom)
u can see on the top bar ‘s link have 3 time of onclick. and on the bottom it is nothing…..
pls help. thx.