You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

24 lines
483 B

class Matomo
module Helpers
def matomo_tag
config = Matomo
return unless config.enabled?
render partial: 'matomo', locals: { config: config }
end
end
cattr_reader :url, :path, :site
def self.load
@@url = ENV.fetch 'MATOMO_URL'
@@site = ENV.fetch 'MATOMO_SITE'
@@disabled = ENV['MATOMO_DISABLED']
end
def self.enabled?
self.url && self.site && @@disabled.nil?
end
ActionView::Base.include Helpers
self.load
end