Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mexpanel

API wrapper for Mixpanel

Installation

If available in Hex, the package can be installed by adding mexpanel to your list of dependencies in mix.exs:

def deps do
  [
    {:mexpanel, "~> 0.1.0"}
  ]
end

Usage

Mixpanel provides 2 endpoints: track and engage.

For both these endpoints, this library provides a struct with builder functions. The new function expects all mandatory parameters, additional properties can be set with functions

Track

alias Mexpanel.TrackRequest
track = TrackRequest.new("123", "user signed up", %{name: "Leif Gensert"})
          |> TrackRequest.time(DateTime.now_utc())
          |> TrackRequest.ip("144.10.58.141")
          |> TrackRequest.distinct_id("user:1")

Mexpanel.request(track)

Engage

For the engage endpoint you will need to specify an operation. See the official documentation for all available operations.

alias Mexpanel.TrackRequest
engage = EngageRequest.new("123", "user:1")
          |> EngageRequest.time(DateTime.now_utc())
          |> EngageRequest.ip("144.10.58.141")
          |> EngageRequest.set(%{name: "Leif Gensert"})

Mexpanel.request(engage)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages