No commit activity in last 3 years
No release in over 3 years
Use Google Tag Manager ( http://www.google.com/tagmanager/ ) in your Rails application.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 3.0.0
 Project Readme

Installation

Add the following to your Gemfile:

gem 'google-tag-manager-rails'

Then run:

bundle install

Example Configuration

In config/environments/production.rb :

GoogleTagManager.gtm_id = "GTM-XXXX" # Where GTM-XXXX is your container ID from Google Tag Manager

In app/views/layouts/application.html.erb:

<body>
  <%= google_tag_manager %>
  ...

Per environment config

google-tag-manager-rails will only write out a tag if GoogleTagManager.gtm_id is set. If you don't set the value in your development, testing, or staging environments, no tags will be written.

If you'd like to add them, in config/environments/{development,staging}.rb :

GoogleTagManager.gtm_id = "GTM-XXXX" # Where GTM-XXXX is your container ID from Google Tag Manager