2021-12-16 15:48:50 +00:00
|
|
|
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__, [])
|
2022-04-06 14:53:20 +00:00
|
|
|
|> Keyword.drop([:enabled, :csp])
|
|
|
|
end
|
|
|
|
|
|
|
|
@doc """
|
|
|
|
The CSP configuration to add for the service to work
|
|
|
|
"""
|
|
|
|
@impl FrontEndAnalytics
|
|
|
|
def csp do
|
|
|
|
:mobilizon
|
|
|
|
|> Application.get_env(__MODULE__, [])
|
|
|
|
|> Keyword.get(:csp, [])
|
2021-12-16 15:48:50 +00:00
|
|
|
end
|
|
|
|
end
|