Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Commit

Permalink
google-analytics-railsを導入
Browse files Browse the repository at this point in the history
  • Loading branch information
YOSHIDA Hiroki committed Nov 7, 2013
1 parent 9886732 commit 290e8c1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,6 @@ gem 'foreman-export-initscript'

# リソース監視
gem 'newrelic_rpm'

# アクセス解析
gem 'google-analytics-rails'
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ GEM
foreman-export-initscript (0.0.1)
foreman
fssm (0.2.10)
google-analytics-rails (0.0.4)
haml (4.0.0)
tilt
hashie (2.0.5)
Expand Down Expand Up @@ -376,6 +377,7 @@ DEPENDENCIES
font-awesome-sass-rails
foreman
foreman-export-initscript
google-analytics-rails
heroku
hpricot
i18n_generators
Expand Down
1 change: 1 addition & 0 deletions app/views/layouts/application.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ html
= javascript_include_tag "application"
== yield :head
= csrf_meta_tags
= analytics_init if Rails.env.production?

body
== render partial: '/base/header'
Expand Down
4 changes: 4 additions & 0 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,8 @@
exception_recipients: %w( hyoshida@appirits.com )
}
)


# for Google Analytics
GA.tracker = ENV['GA_TRACKINGID']
end

0 comments on commit 290e8c1

Please sign in to comment.