diff --git a/Gemfile b/Gemfile index 4f3f2eef..0fda14c8 100644 --- a/Gemfile +++ b/Gemfile @@ -35,6 +35,7 @@ gem 'http_accept_language' gem 'strip_attributes' # Track changes to models' data gem 'paper_trail' +gem 'piwik_analytics' # Validate mails submitted gem 'email_validator' diff --git a/Gemfile.lock b/Gemfile.lock index 6508f569..79edd872 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -45,7 +45,7 @@ GEM erubis (~> 2.7.0) rails-dom-testing (~> 1.0, >= 1.0.5) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview-encoded_mail_to (1.0.7) + actionview-encoded_mail_to (1.0.8) rails activeadmin (1.0.0.pre4) arbre (~> 1.0, >= 1.0.2) @@ -252,6 +252,10 @@ GEM request_store (~> 1.1) parser (2.3.1.4) ast (~> 2.2) + piwik_analytics (1.0.2) + actionpack + activesupport + rails (>= 3.0.0) polyamorous (1.3.1) activerecord (>= 3.0) powerpack (0.1.1) @@ -437,6 +441,7 @@ DEPENDENCIES modernizr-rails mysql2 paper_trail + piwik_analytics quiet_assets rack-livereload rails diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 1ac4a2e1..340bd120 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -77,3 +77,5 @@ = link_to moderations_path do %em.fa.fa-gavel = t '.moderation' + + = piwik_tracking_tag diff --git a/config/piwik.yml b/config/piwik.yml new file mode 100644 index 00000000..5f0a3a52 --- /dev/null +++ b/config/piwik.yml @@ -0,0 +1,33 @@ +# Configuration: +# +# disabled +# false if tracking tag should be shown +# use_async +# Set to true if you want to use asynchronous tracking +# url +# The url of your piwik instance (e.g. localhost/piwik/ +# id_site +# The id of your website inside Piwik +# +production: + piwik: + id_site: 3 + url: piwik.april.org + use_async: true + disabled: false + +development: + piwik: + id_site: 3 + url: piwik.april.org + disabled: true + use_async: false + hostname: localhost + +test: + piwik: + id_site: 3 + url: piwik.april.org + disabled: true + use_async: false + hostname: localhost