Git Product home page Git Product logo

mixpanel's Introduction

Go Mixpanel client

GoDoc

An MIT-licensed Go client library for Mixpanel

Warning

This project is under heavy development and not officially released yet.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

This library doesn't use 3rd party library for its core. But 3rd party library is being used for unit test. If you really want to run unit tests in the project.

go get -u github.com/spf13/viper
go get -u github.com/stretchr/testify/assert

Installing

Use go get to get this library.

go get -u github.com/antonyho/mixpanel

Running the tests

To thoroughly run all tests including Track and Engage, you have to set Mixpanel token to your environment variable. The test will make RESTful calls to your Mixpanel account.

*Nix environment:
export MIXPANEL_TOKEN="<token string from Mixpanel>"
Starting the test:
go test -v ./...

Usage

import github.com/antonyho/mixpanel

Tracking an event

token := "<Mixpanel token from Mixpanel setting page>"
mp := mixpanel.NewClient(token)
event := NewEvent("go-test", props)
event.DistinctID = "2"
event.Time = uint(time.Now().Unix())
event.IP = "8.8.8.8"
event.GroupKey = "MPGO"
event.GroupID = "MPGOTEST"
result, err := mp.Track(event)

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details

TODO

  • GoDoc compatible Documentation
  • More test cases
  • Better instruction on README.md
  • License file
  • Version 1.0.0

mixpanel's People

Contributors

antonyho avatar

Stargazers

Rutger Huijsmans avatar Victor avatar

Watchers

 avatar

Forkers

yougroupteam

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.