- Latest version: 1.2.0
- Supported Go versions: 1.5 … 1.14
This is an unofficial client for the Mixpanel event tracking and data export APIs.
Next to the Go standard library, this library has no dependencies. Versions are correctly tagged---it supports Go Modules.
import "vizzlo.com/mixpanel"
…
// API Token is used to access the event tracking and user engagement API
mp := mixpanel.New(token)
err := mp.Track("abc123…", "My Event", map[string]interface{}{
"property1": "value1",
"property2": 2,
"property3": true,
})
// API Secret is used to access the data export API
client := mixpanel.NewExport(apiSecret)
// Downloads all profiles that have been seen during the last hour
profiles, err := exp.ListProfiles(&mixpanel.ProfileQuery{
LastSeenAfter: time.Now().Add(-time.Hour),
})
For more info, see the API reference or check out the examples folder.