Rails 2.3.5 Implementing Google Tag Manager

Hi,

I need to implement google tag manager in my rails application, which is built in rails 2.3.5 and ruby 1.8.6. while I doing RND on this, I found that google tag manager will be supporting only for rails 3.0.0 and higher version of rails. Can anybody please suggest any links to implement “google tag manager” which support rails 2.3.5.

Best Regards,

Gopinath M

Ruby on Rails Developer

Contact : +91-9994652146

Skype Id : gopinath.murugan

Email : gopi170987@gmail.com

Can you specify where you found this information about the limitations of google tag manager “will be supporting only for rails 3.0.0 and higher” ?

Did you find a Gem or something for this purpose?

Ruby 1.8.6 reached end of life in 2011 (that was 3 years ago!) You have little excuse for not upgrading to at least 1.8.7 (although 1.8.7 technically reached EOL at the end of July, it is in a phase-out period).

As far as upgrading Rails to 3, that may or may not be a big job depending on your Rails app. However, this is a good example of why staying current with Rails is significant because generally Gems aren’t written for older versions of Rails.

Hi Jason,

Thanks for your reply, here is link which says run time dependencies google-tag-manager needs rails >=3.0.0.

https://github.com/rcs/google-tag-manager-rails/blob/master/google-tag-manager-rails.gemspec

https://rubygems.org/gems/google-tag-manager-rails

website have been build 8 yrs back, Now I am maintaining this, they did’t upgrade this current version or atleast rails 3.0.0.

One more question,

Whether is there any possibilities to implement google-tag-manager without gem. in ruby 1.8.6 and rails 2.3.5

Thanks in advance…

Hi Jason,

Thanks for your reply, here is link which says run time dependencies google-tag-manager needs rails >=3.0.0.

https://github.com/rcs/google-tag-manager-rails/blob/master/google-tag-manager-rails.gemspec

https://rubygems.org/gems/google-tag-manager-rails

website have been build 8 yrs back, Now I am maintaining this, they did’t upgrade this current version or atleast rails 3.0.0.

Right. What you have is an “eroded” Rails install and probably upgrading to 3 (note you will probably want to upgrade to 3.2.19) is likely a good idea in the long run.

One more question,

Whether is there any possibilities to implement google-tag-manager without gem. in ruby 1.8.6 and rails 2.3.5

Of course, but you’ll have to implement it yourself. I doubt if anyone will be re-writing that gem for that version Ruby any time soon.

There’s not much code in that gem; looks like the reason it requires >=3.0.0 is that it needs to register a helper, which changed radically between 2.3.x and 3.0. It may be easier to just copy the relevant bits directly into the application.

Regarding the upgrade, you should at the very least either get onto 2.3.16 or manually apply the fixes for CVE-2013-0156 and CVE-2013-0333:

https://groups.google.com/forum/#!topic/rubyonrails-security/61bkgvnSGTQ

https://groups.google.com/forum/#!topic/rubyonrails-security/1h2DR63ViGo

Failing to do so leaves your server vulnerable to a remote-code-execution attack that can be triggered with a single request.

Here’s a guide to upgrading step-by-step through the 2.3.x series. Haven’t tried it, but the steps seem reasonable.

–Matt Jones