Help us shape the future of Go! Take the 2026 Go Developer Survey

mixpanel

package module
v0.0.0-...-59edf22 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2017 License: MIT Imports: 10 Imported by: 0

README

mixpanel

GoDoc Build Status License

Golang client for Mixpanel API

Documentation

Overview

Package mixpanel is an unofficial Go client library for the services provided by MixPanel

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Token   string
	BaseURL string
	Client  *http.Client
}

Client is a client to talk to the API

func New

func New(token string) *Client

New returns a configured client.

func (*Client) Engage

func (m *Client) 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 (*Client) EngageAsScript

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

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

func (*Client) RedirectURL

func (m *Client) 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 (*Client) Track

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

Track sends event data with optional metadata.

func (*Client) TrackAsScript

func (m *Client) TrackAsScript(distinctID string, event string, props Properties) error

TrackAsScript sends event data on behalf of a specific user, without using the current IP address for location determination.

func (*Client) TrackingPixel

func (m *Client) 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
engage command
track command

Jump to

Keyboard shortcuts

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