Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
Use Plausible instead of Piwki/Matomo for analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
ledermann committed Dec 3, 2022
1 parent 836f363 commit ef187cf
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 97 deletions.
11 changes: 0 additions & 11 deletions app/helpers/piwik_helper.rb

This file was deleted.

58 changes: 0 additions & 58 deletions app/javascript/controllers/analytics_controller.js

This file was deleted.

8 changes: 6 additions & 2 deletions app/views/layouts/application.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ html[lang="en"]
= csrf_meta_tags
= csp_meta_tag
= action_cable_meta_tag
= piwik_meta_tags
= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload'
= stylesheet_pack_tag 'application', 'data-turbolinks-track': 'reload'

body data-controller="tooltip icons analytics"
- if Rails.env.production? && Rails.configuration.x.plausible_script
= javascript_include_tag Rails.configuration.x.plausible_script,
defer: true,
data: { domain: Rails.configuration.x.app_host }

body data-controller="tooltip icons"
= render 'layouts/navbar'

#main
Expand Down
6 changes: 3 additions & 3 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ class Application < Rails::Application

config.middleware.insert_after ActionDispatch::Static, Rack::Deflater if ENV['RAILS_SERVE_STATIC_FILES'].present?

config.x.app_email = ENV.fetch('APP_EMAIL', nil)
config.x.piwik_host = ENV.fetch('PIWIK_HOST', nil)
config.x.piwik_id = ENV.fetch('PIWIK_ID', nil)
config.x.app_email = ENV.fetch('APP_EMAIL', nil)
config.x.plausible_script = ENV.fetch('PLAUSIBLE_SCRIPT', nil)
config.x.app_host = ENV.fetch('APP_HOST', nil)
end
end

Expand Down
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ services:
- [email protected]
- APP_ADMIN_PASSWORD=secret
- [email protected]
- PIWIK_HOST=piwik.example.org
- PIWIK_ID=42
- PLAUSIBLE_SCRIPT=https://plausible.example.com/js/script.js
- SMTP_SERVER
- SMTP_PORT
- SMTP_DOMAIN
Expand Down
21 changes: 0 additions & 21 deletions spec/helpers/piwik_helper_spec.rb

This file was deleted.

0 comments on commit ef187cf

Please sign in to comment.