<commit_before>[![Gem Version](https://badge.fury.io/rb/analytics-rails.svg)](http://badge.fury.io/rb/analytics-rails)
[![Code Climate](https://codeclimate.com/github/mmontossi/analytics-rails/badges/gpa.svg)](https://codeclimate.com/github/mmontossi/analytics-rails)
[![Build Status](https://travis-ci.org/mmontossi/analytics-rails.svg)](https://travis-ci.org/mmontossi/analytics-rails)
[![Dependency Status](https://gemnasium.com/mmontossi/analytics-rails.svg)](https://gemnasium.com/mmontossi/analytics-rails)

# Analytics Rails

Adds a helper to create the google analytics script in rails.

## Why

I did this gem to:

- Have a simple but versatile way to include google analytics.

## Install

Put this line in your Gemfile:
```ruby
gem 'analytics-rails'
```

Then bundle:
```
$ bundle
```

## Usage

In your layout add a line like this in your head or before close body (only id required):
```erb
<%= google_analytics_include_tag 'id', metric: 'value' %>
```

And custom events after the include tag (only category and action required):
```erb
<%= google_analytics_event_tag 'Video', 'play', 'Fall Campaign', 42, metric: 'value' %>
```

NOTE: Will only show the tags in production environment.

## Credits

This gem is maintained and funded by [mmontossi](https://github.com/mmontossi).

## License

It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.<commit_msg>Improve readme<commit_after>[![Gem Version](https://badge.fury.io/rb/analytics-rails.svg)](http://badge.fury.io/rb/analytics-rails)
[![Code Climate](https://codeclimate.com/github/mmontossi/analytics-rails/badges/gpa.svg)](https://codeclimate.com/github/mmontossi/analytics-rails)
[![Build Status](https://travis-ci.org/mmontossi/analytics-rails.svg)](https://travis-ci.org/mmontossi/analytics-rails)
[![Dependency Status](https://gemnasium.com/mmontossi/analytics-rails.svg)](https://gemnasium.com/mmontossi/analytics-rails)

# Analytics Rails

Adds a helper to create the google analytics script in rails.

## Why

I did this gem to:

- Have a simple but versatile way to include google analytics.

## Install

Put this line in your Gemfile:
```ruby
gem 'analytics-rails'
```

Then bundle:
```
$ bundle
```

## Usage

### Include

In your layout add a line like this in your head:
```erb
<%= google_analytics_include_tag 'id' %>
```

You can attach metrics if you want:
```erb
<%= google_analytics_include_tag 'id', metric: 'value' %>
```

### Events

After you included the main tag, you can add events:
```erb
<%= google_analytics_event_tag 'Video', 'play' %>
```

Only category and action is required, but you can send label, value and metris if you want:
```ruby
<%= google_analytics_event_tag 'Video', 'play', 'Fall Campaign', 42, metric: 'value' %>
```

NOTE: Tags will only show in production environment.

## Credits

This gem is maintained and funded by [mmontossi](https://github.com/mmontossi).

## License

It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
{'fraction_non_alphanumeric': 0.14511873350923482, 'fraction_numerical': 0.0013192612137203166, 'mean_word_length': 5.005940594059406, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 16, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5462295', 'n_tokens_mistral': 1067, 'n_tokens_neox': 989, 'n_words': 283}