Commit 5b6628a5bccefbf0a356c313d7bad6f6953b207c

Authored by Renan Fichberg
Committed by Diego Camarinha
1 parent 19f3580e

Google Analytics

signed off by: Rafael Reggiani Manzo <rr.manzo@gmail.com>
@@ -60,6 +60,9 @@ gem &#39;spring&#39;, group: :development @@ -60,6 +60,9 @@ gem &#39;spring&#39;, group: :development
60 # Sends a email whenever there is a unexpected exception 60 # Sends a email whenever there is a unexpected exception
61 gem 'exception_notification', '~> 4.0.1' 61 gem 'exception_notification', '~> 4.0.1'
62 62
  63 +# Google Analytics
  64 +gem 'google-analytics-rails', '~> 0.0.6'
  65 +
63 group :test do 66 group :test do
64 # Easier test writing 67 # Easier test writing
65 gem "shoulda-matchers", '~> 2.6.1' 68 gem "shoulda-matchers", '~> 2.6.1'
@@ -124,6 +124,7 @@ GEM @@ -124,6 +124,7 @@ GEM
124 faraday (>= 0.7.4, < 0.10) 124 faraday (>= 0.7.4, < 0.10)
125 gherkin (2.12.2) 125 gherkin (2.12.2)
126 multi_json (~> 1.3) 126 multi_json (~> 1.3)
  127 + google-analytics-rails (0.0.6)
127 hike (1.2.3) 128 hike (1.2.3)
128 i18n (0.6.11) 129 i18n (0.6.11)
129 jbuilder (2.1.3) 130 jbuilder (2.1.3)
@@ -288,6 +289,7 @@ DEPENDENCIES @@ -288,6 +289,7 @@ DEPENDENCIES
288 devise (~> 3.3.0) 289 devise (~> 3.3.0)
289 exception_notification (~> 4.0.1) 290 exception_notification (~> 4.0.1)
290 factory_girl_rails (~> 4.4.1) 291 factory_girl_rails (~> 4.4.1)
  292 + google-analytics-rails (~> 0.0.6)
291 jbuilder (~> 2.1.2) 293 jbuilder (~> 2.1.2)
292 jquery-rails 294 jquery-rails
293 jquery-ui-rails (~> 5.0.0) 295 jquery-ui-rails (~> 5.0.0)
app/views/layouts/application.html.erb
@@ -38,6 +38,9 @@ @@ -38,6 +38,9 @@
38 38
39 <%= javascript_include_tag "application" %> 39 <%= javascript_include_tag "application" %>
40 40
  41 + <!-- Google Analytics -->
  42 + <%= analytics_init if Rails.env.production? %>
  43 +
41 <%= csrf_meta_tags %> 44 <%= csrf_meta_tags %>
42 </head> 45 </head>
43 <body> 46 <body>
config/environments/production.rb
@@ -105,4 +105,8 @@ Rails.application.configure do @@ -105,4 +105,8 @@ Rails.application.configure do
105 :sender_address => %{"mezurometrics" <mezurometrics@gmail.com>}, 105 :sender_address => %{"mezurometrics" <mezurometrics@gmail.com>},
106 :exception_recipients => %w{mezuro-core@lists.ime.usp.br} 106 :exception_recipients => %w{mezuro-core@lists.ime.usp.br}
107 } 107 }
  108 +
  109 + # Google Analytics
  110 + GA.tracker = "<%= ENV['GA_TRACKER'] %>" #"UA-54363591-1"
  111 + GA.script_source = :doubleclick
108 end 112 end