Documentation
¶
Index ¶
- type Mixpanel
- func (m *Mixpanel) Engage(distinctID string, props Properties, op *Operation) error
- func (m *Mixpanel) EngageAsScript(distinctID string, props Properties, op *Operation) error
- func (m *Mixpanel) RedirectURL(distinctID, event, uri string, props Properties) (string, error)
- func (m *Mixpanel) Track(distinctID string, event string, props Properties) error
- func (m *Mixpanel) TrackingPixel(distinctID, event string, props Properties) (string, error)
- type Operation
- type Properties
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mixpanel ¶
Mixpanel is a client to talk to the API
func NewMixpanel ¶
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.