tracker

package
v1.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2022 License: BSD-2-Clause Imports: 9 Imported by: 2

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL