Documentation ¶
Index ¶
Constants ¶
View Source
const DailyView = 90
DailyView forces the "view by day" if the number of selected days is larger than this.
Variables ¶
This section is empty.
Functions ¶
func NewBackend ¶
Types ¶
type APICountRequest ¶
type APICountRequest struct { // Don't try to count unique visitors; every pageview will be considered a // "visit". NoSessions bool `json:"no_sessions"` Hits []APICountRequestHit `json:"hits"` }
type APICountRequestHit ¶
type APICountRequestHit struct { // Path of the pageview, or the event name. {required} Path string `json:"path"` // Page title, or some descriptive event title. Title string `json:"title"` // Is this an event? Event zdb.Bool `json:"event"` // Referrer value, can be an URL (i.e. the Referal: header) or any // string. Ref string `json:"ref"` // Screen size as "x,y,scaling" Size zdb.Floats `json:"size"` // Query parameters for this pageview, used to get campaign parameters. Query string `json:"query"` // Hint if this should be considered a bot; should be one of the JSBot*` // constants from isbot; note the backend may override this if it // detects a bot using another method. // https://github.com/zgoat/isbot/blob/master/isbot.go#L28 Bot int `json:"bot"` // User-Agent header. UserAgent string `json:"user_agent"` // Location as ISO-3166-1 alpha2 string (e.g. NL, ID, etc.) Location string `json:"location"` // IP to get location from; not used if location is set. Also used for // session generation. IP string `json:"ip"` // Time this pageview should be recorded at; this can be in the past, // but not in the future. CreatedAt time.Time `json:"created_at"` // Normally a session is based on hash(User-Agent+IP+salt), but if you don't // send the IP address then we can't determine the session. // // In those cases, you can store your own session identifiers and send them // along. Note these will not be stored in the database as the sessionID // (just as the hashes aren't), they're just used as a unique grouping // identifier. // // You can also just disable sessions entirely with NoSessions. Session string `json:"session"` }
type Session ¶
type Session struct { ClientReferenceID string `json:"client_reference_id"` Customer string `json:"customer"` DisplayItems []struct { Amount int `json:"amount"` Currency string `json:"currency"` Quantity int `json:"quantity"` Plan struct { ID string `json:"id"` } `json:"plan"` } `json:"display_items"` }
Click to show internal directories.
Click to hide internal directories.