- Add plausible_proxy to your mix dependencies
def deps do
[
{:plausible_proxy, "~> 0.1.1"}
]
end
- Add PlausibleProxy.Plug to your Endpoint before your router:
defmodule MyAppWeb.Endpoint do
...
plug PlausibleProxy.Plug
...
plug MyAppWeb.Router
end
- Add a script tag to your site referencing the local path:
<script
defer
data-domain="{MyAppWeb.Endpoint.config(:url)[:host]}"
src="/js/plausible_script.js"
></script>
See PlausibleProxy.Plug for optional configuration.