View Source Plausible.Client (Plausible Analytics v0.1.0)
Plausible.Client
provides a wrapper to internal for calling to functions defined on Plausible
module.
Usage
- Create your client module.
defmodule MyApp.Plausible do
use Plausible.Client, finch_pool_name: MyApp.Finch
end
Optional options include plausbile_host_url
where the base_url of self hosted plausible can be passed in.
- Once module is defined can use
create_event/1
as below to send event to Plausible host.
:ok = MyApp.Plausible.create_event(user_agent: user_agent, x_forwarded_for: x_forwarded_for, url: url, domain: domain)