Skip to content

rjocoleman/middleman-google-tag-manager

Repository files navigation

middleman-google-tag-manager

A Middleman extension for use with Google Tag Manager.

Features

  • Automatically places Google Tag Manager code on all configured pages.

Installation

  gem 'middleman-google-tag-manager', '~> 1'
  • Use middleman-google-tag-manager version ~> 1 for Middleman 4+
  • Use middleman-google-tag-manager version < 1 for Middleman 3.x

Setup and Configuration

In config.rb

activate :google_tag_manager do |gtm|
  gtm.container_id = 'your Google Tag Manager container ID' # required
  gtm.development = true # Render tag in development environment
end

Helper and Usage

Examples for ERB templates:

<%= google_tag_manager %>
# e.g. use in layout.erb

See also

License

The gem is available as open source under the terms of the MIT License.

About

Google Tag Manager for Middleman Static Sites

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages