A Middleman extension for use with Google Tag Manager.
Features
- Automatically places Google Tag Manager code on all configured pages.
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
Examples for ERB templates:
<%= google_tag_manager %>
# e.g. use in layout.erb
- Google Analytics https://github.com/danielbayerlein/middleman-google-analytics - (several ideas taken from here :)
The gem is available as open source under the terms of the MIT License.