diff --git a/Gemfile b/Gemfile index 71986594..f218fdfe 100644 --- a/Gemfile +++ b/Gemfile @@ -13,7 +13,6 @@ gem 'coffee-rails', '~> 4.2' gem 'jquery-rails' gem 'turbolinks' gem 'jbuilder', '~> 2.5' -gem 'piwik_analytics', '~> 1.0.2' gem 'geocoder', '~> 1.2.1' gem 'devise', '~> 4.3' gem 'rakismet' diff --git a/Gemfile.lock b/Gemfile.lock index c063a32b..0b034a32 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -242,10 +242,6 @@ GEM activerecord (>= 4.2) activesupport (>= 4.2) arel (>= 6) - piwik_analytics (1.0.2) - actionpack - activesupport - rails (>= 3.0.0) poltergeist (1.16.0) capybara (~> 2.1) cliver (~> 0.3.1) @@ -416,7 +412,6 @@ DEPENDENCIES mail_form (>= 1.7.0) pg pg_search - piwik_analytics (~> 1.0.2) poltergeist pry puma diff --git a/app/views/layouts/_footer.html.haml b/app/views/layouts/_footer.html.haml index 784abb51..7bf1920e 100644 --- a/app/views/layouts/_footer.html.haml +++ b/app/views/layouts/_footer.html.haml @@ -18,3 +18,4 @@ %a{:href => "https://patreon.com/refugerestrooms"} #{t('.on-patreon')} %br/ = "\© #{t('.copyleft')} #{Date.today.year} #{t('.refuge-restrooms')}".html_safe + diff --git a/app/views/layouts/_ga_tag.html.haml b/app/views/layouts/_ga_tag.html.haml deleted file mode 100644 index e3e8d5f7..00000000 --- a/app/views/layouts/_ga_tag.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -:javascript - // Google analytics code - (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ - (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), - m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) - })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); - - ga('create', 'UA-39929615-2', 'refugerestrooms.org'); - ga('send', 'pageview'); diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml index fd43ba10..e3e4a3fd 100644 --- a/app/views/layouts/_head.html.haml +++ b/app/views/layouts/_head.html.haml @@ -10,3 +10,5 @@ = stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true = javascript_include_tag "application", "data-turbolinks-track" => true = csrf_meta_tags += render 'layouts/piwik_tag' + diff --git a/app/views/layouts/_piwik_tag.html.haml b/app/views/layouts/_piwik_tag.html.haml new file mode 100644 index 00000000..cd5ac8a7 --- /dev/null +++ b/app/views/layouts/_piwik_tag.html.haml @@ -0,0 +1,14 @@ + +:javascript + var _paq = _paq || []; + /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ + _paq.push(['trackPageView']); + _paq.push(['enableLinkTracking']); + (function() { + var u="https://refugerestrooms.innocraft.cloud/"; + _paq.push(['setTrackerUrl', u+'piwik.php']); + _paq.push(['setSiteId', '1']); + var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; + g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); + })(); + diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 8c98deab..a8af5468 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -13,4 +13,3 @@ = yield = render 'layouts/footer' - = render 'layouts/ga_tag' diff --git a/app/views/layouts/splash.html.haml b/app/views/layouts/splash.html.haml index 03f81b0e..f43924ea 100644 --- a/app/views/layouts/splash.html.haml +++ b/app/views/layouts/splash.html.haml @@ -7,5 +7,3 @@ = render 'layouts/navigation' .container = yield - = render 'layouts/ga_tag' - = piwik_tracking_tag diff --git a/config/piwik.yml b/config/piwik.yml deleted file mode 100644 index 26d7e1db..00000000 --- a/config/piwik.yml +++ /dev/null @@ -1,33 +0,0 @@ -# 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: 2 - url: analytics.enspiral.info - use_async: true - disabled: false - -development: - piwik: - id_site: 1 - url: localhost - disabled: true - use_async: false - hostname: localhost - -test: - piwik: - id_site: 1 - url: localhost - disabled: true - use_async: false - hostname: localhost