An Elixir client for the Mixpanel HTTP API. See mixpanel.com.
- Add mixpanel to your deps:
{:mixpanel, "0.0.1"}- Add
:mixpanelto the list of application dependencies in yourmix.exs.
def application do
[applications: [:logger, :mixpanel]]
end- Add your mixpanel token to your
config/config.exs(or similar):
config :mixpanel, token: "<YOUR API TOKEN HERE>"- Track events with
Mixpanel.track:
Mixpanel.track("login", distinct_id: 123)
Mixpanel.track("visited TOS")MIT