Gem Version Code Climate Build Status Dependency Status

Analytics Rails

Adds a simple helper to create the google analytics include tag.

Install

Put this line in your Gemfile:

gem 'analytics-rails'

Then bundle:

$ bundle

Usage

In your layout add a line like this in your head:

<%= google_analytics_include_tag 'your-id' %>

You can add custom events:

<%= google_analytics_include_tag 'your-id', events: [['Popup', 'Click']] %>

And custom variables:

<%= google_analytics_include_tag 'your-id', variables: [[1, 'Member', 'Yes', 1]] %>

NOTE: Will only show the include tag in production environment.

Credits

This gem is maintained and funded by museways.

License

It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.