README.md in analytics-rails-0.3.3 vs README.md in analytics-rails-0.3.4

- old
+ new

@@ -25,25 +25,34 @@ $ bundle ``` ## Usage -In your layout add a line like this in your head or before close body: +Include tag must be added before any other tag in order to work and only will be shown in production. + +### Include + +In your layout add a line like this in your head: ```erb -<%= google_analytics_include_tag 'your-id' %> +<%= google_analytics_include_tag 'id' %> ``` -You can add variables: +You can add metrics if you want: ```erb -<%= google_analytics_include_tag 'your-id', user: 1 %> +<%= google_analytics_include_tag 'id', metric: 'value' %> ``` -And custom events after the include tag: +### Events + +To send events add a line like this with the category and action: ```erb -<%= google_analytics_event_tag 'popup', 'click' %> +<%= google_analytics_event_tag 'Video', 'play' %> ``` -NOTE: Will only show the tags in production environment. +You can add label, value and other options too if you want: +```erb +<%= google_analytics_event_tag 'Video', 'play', 'Fall Campaign', 42, metric: 'value' %> +``` ## Credits This gem is maintained and funded by [mmontossi](https://github.com/mmontossi).