Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Types = newEventTypes()
Types of events
Functions ¶
This section is empty.
Types ¶
type BaseEvent ¶
type BaseEvent struct { TrackingID string `json:"tid"` ClientIP string `json:"-"` CountryCode string `json:"country,omitempty"` UserAgent string `json:"-"` Browser string `json:"browser"` OS string `json:"os"` Tags map[string]string `json:"tags"` Timestamp time.Time `json:"timestamp"` }
BaseEvent contains common events fields
func NewBaseEvent ¶ added in v1.1.1
NewBaseEvent create new base event
func (BaseEvent) FormattedTS ¶ added in v1.1.1
FormattedTS returns formatted timestamp
type Event ¶
type Event interface { // Type returns event type Type() string // TS returns event timestamp TS() time.Time // FormattedTS returns event formated timestamp FormattedTS() string // Labels return event labels Labels() Labels }
Event is the generic interface for a tracking event
func NewExceptionEvent ¶
NewExceptionEvent create exception event from HTTP request
func NewPageViewEvent ¶
NewPageViewEvent create page view event from HTTP request
type Exception ¶
type Exception struct { BaseEvent Message string `json:"msg"` Line int `json:"line"` Column int `json:"column"` URL string `json:"url"` Error string `json:"error"` }
Exception contains tracked attribute when an error is triggered
func (Exception) FormattedTS ¶
FormattedTS returns formatted timestamp
type PageView ¶
type PageView struct { BaseEvent Protocol string `json:"-"` UserLanguage string `json:"language"` DocumentHostName string `json:"hostname"` DocumentPath string `json:"path"` DocumentReferer string `json:"referer"` IsNewVisitor bool `json:"new_visitor"` IsNewSession bool `json:"new_session"` TimeOnPage int `json:"top"` }
PageView contains tracked attribute when a page is viewed
func (PageView) FormattedTS ¶
FormattedTS returns formatted timestamp
type SimpleEvent ¶
SimpleEvent contains tracked attribute for a simple event
func (SimpleEvent) FormattedTS ¶
func (se SimpleEvent) FormattedTS() string
FormattedTS returns formatted timestamp
Click to show internal directories.
Click to hide internal directories.