debianize-mobilizon/lib/service/front_end_analytics/plausible.ex
Thomas Citharel 709d26735b
Provide analytics on Front-end
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2022-04-06 12:31:46 +02:00

32 lines
640 B
Elixir

defmodule Mobilizon.Service.FrontEndAnalytics.Plausible do
@moduledoc """
Plausible analytics provider
"""
alias Mobilizon.Service.FrontEndAnalytics
@behaviour FrontEndAnalytics
@impl FrontEndAnalytics
def id, do: "plausible"
@doc """
Whether the service is enabled
"""
@impl FrontEndAnalytics
def enabled? do
:mobilizon
|> Application.get_env(__MODULE__, [])
|> Keyword.get(:enabled, false)
end
@doc """
The configuration for the service
"""
@impl FrontEndAnalytics
def configuration do
:mobilizon
|> Application.get_env(__MODULE__, [])
|> Keyword.drop([:enabled])
end
end