Documentation ¶
Overview ¶
Example ¶
// Sample package usage: wt, _ := NewTracker(map[string]string{ "host": "sample-host.com", }) wt.Identify( Person{"John Coltrane", "coltrane@johns.com"}, ).Track("login", map[string]string{ "through": "mobile", "when": "yesterday", "mood": "Really good", })
Output:
Index ¶
Examples ¶
Constants ¶
View Source
const ( // To track events in Woopra, send Http GET requests to: TRACK_API_ENDPOINT = "https://www.woopra.com/track/ce" // Identify requests can be used to ID a visitor and/or add properties to that visitor. The endpoint is: IDENTIFY_API_ENDPOINT = "https://www.woopra.com/track/identify" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { Tracker Person Event string VisitorProperties map[string]string UserAgent string }
Context is an intermediate representation of concatenated track-request specific data
type Tracker ¶
Tracker used for storing sharable settings
func NewTracker ¶
NewTracker creates new instance of sharable Tracker struct
func (Tracker) Identify ¶
Identify is used to create reusable person-specific association. Last (optional) argument is used to proxy UserAgent data to Woopra
Example ¶
// Usage with proxying client's `User-agent` to Woopra wt, _ := NewTracker(map[string]string{ "host": "medcare.clinic", }) wt.Identify( Person{"Miles Davis", "coltrane@johns.com"}, // can be grabbed with http.Request.UserAgent() "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/601.7.7 (KHTML, like Gecko) Version/9.1.2 Safari/601.7.7", ).Track("login", map[string]string{ "through": "mobile", "when": "yesterday", "mood": "Really good", })
Output:
Click to show internal directories.
Click to hide internal directories.