mixpanel

package module
v0.0.0-...-9b81eaf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2015 License: MIT Imports: 8 Imported by: 6

README

go-mixpanel

GoDoc Circle CI

Golang client for Mixpanel API

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mixpanel

type Mixpanel struct {
	Token   string
	BaseUrl string
}

Mixpanel is a client to talk to the API

func NewMixpanel

func NewMixpanel(token string) *Mixpanel

NewMixpanel returns a configured client.

func (*Mixpanel) Engage

func (m *Mixpanel) Engage(distinctID string, props Properties, op *Operation) error

Engage updates profile data. This will update the IP and related data on the profile. If you don't have the IP address of the user, then use the UpdateProperties method instead, otherwise the user's location will be set to wherever the script was run from.

func (*Mixpanel) EngageAsScript

func (m *Mixpanel) EngageAsScript(distinctID string, props Properties, op *Operation) error

EngageAsScript calls the engage endpoint, but doesn't set IP, city, country, on the profile.

func (*Mixpanel) RedirectURL

func (m *Mixpanel) RedirectURL(distinctID, event, uri string, props Properties) (string, error)

RedirectURL returns a url that, when clicked, will track the given data and then redirect to provided url.

func (*Mixpanel) Track

func (m *Mixpanel) Track(distinctID string, event string, props Properties) error

Track sends event data with optional metadata.

func (*Mixpanel) TrackingPixel

func (m *Mixpanel) TrackingPixel(distinctID, event string, props Properties) (string, error)

TrackingPixel returns a url that, when clicked, will track the given data and then redirect to provided url.

type Operation

type Operation struct {
	Name   string
	Values Properties
}

Operation is an action performed on a user profile. Typically this is $set or $unset, but others are available.

type Properties

type Properties map[string]interface{}

Properties are key=value pairs that decorate an event or a profile.

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL