Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Track ¶
func Track(params TrackingParams, w http.ResponseWriter, r *http.Request)
Track is an HTTP handler function that sends tracking objects provided by browsers to a channel.
Types ¶
type TrackingObject ¶
type TrackingObject struct { UA UserAgent `json:"ua"` UserAgent string `json:"userAgent"` Referer string `json:"referer"` IPAddress string `json:"ipAddress"` Time int64 `json:"time"` Target map[string]interface{} `json:"target"` }
TrackingObject holds all data that is eventually sent to Kafka.
type TrackingParams ¶ added in v1.11.0
type TrackingParams struct { TrackingChannel chan<- *TrackingObject AnonymizeIP bool }
TrackingParams encapsulates the parameters passed to Track.
type UserAgent ¶ added in v1.7.0
type UserAgent struct { Bot bool `json:"bot"` Mobile bool `json:"mobile"` BrowserName string `json:"browserName"` BrowserVersion string `json:"browserVersion"` Locale string `json:"locale"` OS string `json:"os"` Platform string `json:"platform"` }
UserAgent holds values that are provided by the browser's "User-Agent" HTTP header.
Click to show internal directories.
Click to hide internal directories.