Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
// Category is the event category
Category string `ga:"ec"`
// Action is the event action
Action string `ga:"ea"`
// Label is the event label
Label string `ga:"el"`
// Value event value
Value string `ga:"ev"`
}
Event sends an event hit type.
type Exception ¶
type Exception struct {
// Description is the exception description. i.e. IOException
Description string `ga:"exd"`
// Fatal is if the exception was fatal.
Fatal bool `ga:"exf"`
}
Exception sends an exception hit type.
type GA ¶
type GA struct {
// XX-XXXXXXX-X
TrackingID string `ga:"tid"`
// ClientID is the Anonymous ID
ClientID string `ga:"cid"`
// contains filtered or unexported fields
}
GA is how we send events to Google Analytics
func (*GA) UserTiming ¶
func (g *GA) UserTiming(e UserTiming) error
UserTiming sends user timings to Google Analytics
type GAHandler ¶
type GAHandler struct {
TrackerIDs map[string]string
// TODO
IgnorePaths []string
// contains filtered or unexported fields
}
GAHandler is a middleware which logs backend requests to Google Analytics.
trackerIds := map[string]string{
"api.acksin.com": "UA-XXXXXXX-1",
"default": "UA-XXXXXXX-2",
}
gameasure.NewGAHandler(r, trackerIds)
func NewGAHandler ¶
NewGAHandler creates a new GAHandler. Pass in a map of the Host to TrackingID. Pass a default key for a default trackingid
trackerIds := map[string]string{
"api.acksin.com": "UA-XXXXXXX-1",
"default": "UA-XXXXXXX-2",
}
type Pageview ¶
type Pageview struct {
// DocumentHost is the Document hostname example.com
DocumentHost string `ga:"dh"`
// Page is the page path. Ex. /foo/bar
Page string `ga:"dp"`
// Title is the page title. Ex The foobar page
Title string `ga:"dt"`
}
Pageview sends events for pageviews.
type UserTiming ¶
type UserTiming struct {
// Category is the timing category. e.g. jsonLoader
Category string `ga:"utc"`
// Variable is the timing variable. e.g. load
Variable string `ga:"utv"`
// Time is the time it took in milliseconds.
Time time.Duration `ga:"utt"`
// Label is the timing label. e.g jQuery
Label string `ga:"utl"`
// contains filtered or unexported fields
}
UserTiming sends a timing hit type.
Click to show internal directories.
Click to hide internal directories.