Reads the settings for the tracking script.
Settings come from three places. The first one found wins:
- Options passed to the call (for example
PrivatusAnalytics.tag(modules: ["engage"])). - Application config,
config :privatus_analytics, .... - Built-in defaults (and the
PRIVATUS_SITE_IDandPRIVATUS_SCRIPT_HOSTenvironment variables for the site id and script host).
Which environments get the tag
enabled: true or enabled: false forces the tag on or off. When enabled
is not set, the tag prints only when the current environment is in
enabled_environments (default [:prod]). The current environment is:
- the
:envsetting, if you set it (we recommendconfig :privatus_analytics, env: config_env()inconfig/config.exs), - else
Mix.env()when Mix is running (mix phx.server,mix test), - else
:prod. Mix is not part of a release, so a release counts as production.
Summary
Functions
The tracker origin used when nothing else is set.
Whether the tag should print for these options.
The environment used to decide if the tag prints. See the module docs.
The origin that serves /js/pa.js, without a trailing slash.
The site id (starts with pa_), or nil. Falls back to PRIVATUS_SITE_ID.
Functions
The tracker origin used when nothing else is set.
Whether the tag should print for these options.
The environment used to decide if the tag prints. See the module docs.
The origin that serves /js/pa.js, without a trailing slash.
The site id (starts with pa_), or nil. Falls back to PRIVATUS_SITE_ID.