View Source Plausible (Plausible Analytics v0.1.0)
Plausible
is a library to push analytics event to Plausible Analytics.
The library provides two working mode to push events.
Installation
- Add
:plausible
to your projectmix.exs
dependencies
def deps() do
[ #other dependendencies excluded here
{:plausible, "~> 0.1.0"}
]
end
- Initialize
finch
process in your app supervision tree.
def start(_type, _arg) do
children = [{Finch, name: MyApp.Finch}]
end
Usages
The library provides two working modes as listed below
- Use
Plausible.Client
as the wrapper toPlausible
module so you can pass in less parameters. - Or use
Plausible
directly that accepts a finch process name and keywordopts
parameter directly to send event to Plausible Analytics Host.
The document can be found on each Plausible
and Plausible.Client
Contributions
All contributions are welcome. Please visit https://github.com/blisscs/plausible and create issue or pull request there.
Summary
Functions
Create Plausible Event
Functions
Link to this function
create_event(endpoint \\ "https://plausible.io", finch_process, opts)
View SourceCreate Plausible Event
Currently only returns :ok
Examples
iex> create_event(MyApp.Finch, user_agent: user_agent, x_forwarded_for: x_forwarded_for, url: url, domain: domain)
:ok