Documentation ¶
Index ¶
- type ActiveVisitorStats
- type AvgTimeSpentStats
- type Bot
- type BrowserStats
- type BrowserVersionStats
- type CityStats
- type ConversionsStats
- type CountryStats
- type EntryStats
- type Event
- type EventListStats
- type EventStats
- type ExitStats
- type Growth
- type GrowthStats
- type LanguageStats
- type MetaStats
- type OSStats
- type OSVersionStats
- type PageStats
- type PageView
- type PlatformStats
- type ReferrerStats
- type ScreenClassStats
- type Session
- type TimeSpentStats
- type TotalVisitorSessionStats
- type TotalVisitorStats
- type TotalVisitorsPageViewsStats
- type UTMCampaignStats
- type UTMContentStats
- type UTMMediumStats
- type UTMSourceStats
- type UTMTermStats
- type UserAgent
- type VisitorHourStats
- type VisitorStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActiveVisitorStats ¶
type ActiveVisitorStats struct { Path string `json:"path"` Title string `json:"title"` Visitors int `json:"visitors"` }
ActiveVisitorStats is the result type for active visitor statistics.
type AvgTimeSpentStats ¶
type AvgTimeSpentStats struct { Path string AverageTimeSpentSeconds int `db:"average_time_spent_seconds"` }
AvgTimeSpentStats is the average time spent on a page.
type Bot ¶
type Bot struct { ClientID uint64 `db:"client_id" json:"client_id"` VisitorID uint64 `db:"visitor_id" json:"visitor_id"` Time time.Time `json:"time"` UserAgent string `db:"user_agent"` Path string `json:"path"` Event string `db:"event_name" json:"event"` }
Bot represents a visitor or event that has been ignored. The creation time, User-Agent, path, and event name are stored in the database to find bots.
type BrowserStats ¶
BrowserStats is the result type for browser statistics.
type BrowserVersionStats ¶
type BrowserVersionStats struct { MetaStats Browser string `json:"browser"` BrowserVersion string `db:"browser_version" json:"browser_version"` }
BrowserVersionStats is the result type for browser version statistics.
type CityStats ¶
type CityStats struct { MetaStats CountryCode string `db:"country_code" json:"country_code"` City string `json:"city"` }
CityStats is the result type for city statistics.
type ConversionsStats ¶
type ConversionsStats struct { Visitors int `json:"visitors"` Views int `json:"views"` CR float64 `json:"cr"` CustomMetricAvg float64 `db:"custom_metric_avg" json:"custom_metric_avg"` CustomMetricTotal float64 `db:"custom_metric_total" json:"custom_metric_total"` }
ConversionsStats is the result type for page conversions.
type CountryStats ¶
CountryStats is the result type for country statistics.
type EntryStats ¶
type EntryStats struct { Path string `db:"entry_path" json:"path"` Title string `json:"title"` Visitors int `json:"visitors"` Sessions int `json:"sessions"` Entries int `json:"entries"` EntryRate float64 `db:"entry_rate" json:"entry_rate"` AverageTimeSpentSeconds int `db:"average_time_spent_seconds" json:"average_time_spent_seconds"` }
EntryStats is the result type for entry page statistics.
func (EntryStats) GetPath ¶
func (stats EntryStats) GetPath() string
type Event ¶
type Event struct { ClientID uint64 `db:"client_id" json:"client_id"` VisitorID uint64 `db:"visitor_id" json:"visitor_id"` Time time.Time `json:"time"` SessionID uint32 `db:"session_id" json:"session_id"` Name string `db:"event_name" json:"name"` MetaKeys []string `db:"event_meta_keys" json:"meta_keys"` MetaValues []string `db:"event_meta_values" json:"meta_values"` DurationSeconds uint32 `db:"duration_seconds" json:"duration_seconds"` Path string `json:"path"` Title string `json:"title"` Language string `json:"language"` CountryCode string `db:"country_code" json:"country_code"` City string `json:"city"` Referrer string `json:"referrer"` ReferrerName string `db:"referrer_name" json:"referrer_name"` ReferrerIcon string `db:"referrer_icon" json:"referrer_icon"` OS string `json:"os"` OSVersion string `db:"os_version" json:"os_version"` Browser string `json:"browser"` BrowserVersion string `db:"browser_version" json:"browser_version"` Desktop bool `json:"desktop"` Mobile bool `json:"mobile"` ScreenClass string `db:"screen_class" json:"screen_class"` UTMSource string `db:"utm_source" json:"utm_source"` UTMMedium string `db:"utm_medium" json:"utm_medium"` UTMCampaign string `db:"utm_campaign" json:"utm_campaign"` UTMContent string `db:"utm_content" json:"utm_content"` UTMTerm string `db:"utm_term" json:"utm_term"` }
Event represents a single data point for custom events. It's basically the same as Session, but with some additional fields (event name, time, and meta fields).
type EventListStats ¶
type EventListStats struct { Name string `db:"event_name" json:"name"` Meta map[string]string `json:"meta"` Visitors int `json:"visitors"` Count int `json:"count"` }
EventListStats is the result type for a custom event list.
type EventStats ¶
type EventStats struct { Name string `db:"event_name" json:"name"` Count int `json:"count"` Visitors int `json:"visitors"` Views int `json:"views"` CR float64 `json:"cr"` AverageDurationSeconds int `db:"average_time_spent_seconds" json:"average_duration_seconds"` MetaKeys []string `db:"meta_keys" json:"meta_keys"` MetaValue string `db:"meta_value" json:"meta_value"` }
EventStats is the result type for custom events.
type ExitStats ¶
type ExitStats struct { Path string `db:"exit_path" json:"path"` Title string `json:"title"` Visitors int `json:"visitors"` Sessions int `json:"sessions"` Exits int `json:"exits"` ExitRate float64 `db:"exit_rate" json:"exit_rate"` }
ExitStats is the result type for exit page statistics.
type Growth ¶
type Growth struct { VisitorsGrowth float64 `json:"visitors_growth"` ViewsGrowth float64 `json:"views_growth"` SessionsGrowth float64 `json:"sessions_growth"` BouncesGrowth float64 `json:"bounces_growth"` TimeSpentGrowth float64 `json:"time_spent_growth"` CRGrowth float64 `json:"cr_growth"` CustomMetricAvgGrowth float64 `json:"custom_metric_avg_growth"` CustomMetricTotalGrowth float64 `json:"custom_metric_total_growth"` }
Growth represents the visitors, views, sessions, bounces, and average session duration growth between two time periods.
type GrowthStats ¶
type GrowthStats struct { Visitors int Views int Sessions int Bounces int BounceRate float64 `db:"bounce_rate"` CR float64 CustomMetricAvg float64 `db:"custom_metric_avg" json:"custom_metric_avg"` CustomMetricTotal float64 `db:"custom_metric_total" json:"custom_metric_total"` }
GrowthStats is the sum to calculate the growth rate.
type LanguageStats ¶
LanguageStats is the result type for language statistics.
type MetaStats ¶
type MetaStats struct { Visitors int `json:"visitors"` RelativeVisitors float64 `db:"relative_visitors" json:"relative_visitors"` }
MetaStats is the base for meta result types (languages, countries, ...).
type OSVersionStats ¶
type OSVersionStats struct { MetaStats OS string `json:"os"` OSVersion string `db:"os_version" json:"os_version"` }
OSVersionStats is the result type for operating system version statistics.
type PageStats ¶
type PageStats struct { Path string `json:"path"` Title string `json:"title"` Visitors int `json:"visitors"` Views int `json:"views"` Sessions int `json:"sessions"` Bounces int `json:"bounces"` RelativeVisitors float64 `db:"relative_visitors" json:"relative_visitors"` RelativeViews float64 `db:"relative_views" json:"relative_views"` BounceRate float64 `db:"bounce_rate" json:"bounce_rate"` AverageTimeSpentSeconds int `db:"average_time_spent_seconds" json:"average_time_spent_seconds"` }
PageStats is the result type for page statistics.
type PageView ¶
type PageView struct { ClientID uint64 `db:"client_id" json:"client_id"` VisitorID uint64 `db:"visitor_id" json:"visitor_id"` SessionID uint32 `db:"session_id" json:"session_id"` Time time.Time `json:"time"` DurationSeconds uint32 `db:"duration_seconds" json:"duration_seconds"` Path string `json:"path"` Title string `json:"title"` Language string `json:"language"` CountryCode string `db:"country_code" json:"country_code"` City string `json:"city"` Referrer string `json:"referrer"` ReferrerName string `db:"referrer_name" json:"referrer_name"` ReferrerIcon string `db:"referrer_icon" json:"referrer_icon"` OS string `json:"os"` OSVersion string `db:"os_version" json:"os_version"` Browser string `json:"browser"` BrowserVersion string `db:"browser_version" json:"browser_version"` Desktop bool `json:"desktop"` Mobile bool `json:"mobile"` ScreenClass string `db:"screen_class" json:"screen_class"` UTMSource string `db:"utm_source" json:"utm_source"` UTMMedium string `db:"utm_medium" json:"utm_medium"` UTMCampaign string `db:"utm_campaign" json:"utm_campaign"` UTMContent string `db:"utm_content" json:"utm_content"` UTMTerm string `db:"utm_term" json:"utm_term"` }
PageView represents a single page visit.
type PlatformStats ¶
type PlatformStats struct { PlatformDesktop int `db:"platform_desktop" json:"platform_desktop"` PlatformMobile int `db:"platform_mobile" json:"platform_mobile"` PlatformUnknown int `db:"platform_unknown" json:"platform_unknown"` RelativePlatformDesktop float64 `db:"relative_platform_desktop" json:"relative_platform_desktop"` RelativePlatformMobile float64 `db:"relative_platform_mobile" json:"relative_platform_mobile"` RelativePlatformUnknown float64 `db:"relative_platform_unknown" json:"relative_platform_unknown"` }
PlatformStats is the result type for platform statistics.
type ReferrerStats ¶
type ReferrerStats struct { Referrer string `json:"referrer"` ReferrerName string `db:"referrer_name" json:"referrer_name"` ReferrerIcon string `db:"referrer_icon" json:"referrer_icon"` Visitors int `json:"visitors"` Sessions int `json:"sessions"` RelativeVisitors float64 `db:"relative_visitors" json:"relative_visitors"` Bounces int `json:"bounces"` BounceRate float64 `db:"bounce_rate" json:"bounce_rate"` }
ReferrerStats is the result type for referrer statistics.
type ScreenClassStats ¶
type ScreenClassStats struct { MetaStats ScreenClass string `db:"screen_class" json:"screen_class"` }
ScreenClassStats is the result type for screen class statistics.
type Session ¶
type Session struct { Sign int8 `json:"sign"` ClientID uint64 `db:"client_id" json:"client_id"` VisitorID uint64 `db:"visitor_id" json:"visitor_id"` SessionID uint32 `db:"session_id" json:"session_id"` Time time.Time `json:"time"` Start time.Time `json:"start"` DurationSeconds uint32 `db:"duration_seconds" json:"duration_seconds"` EntryPath string `db:"entry_path" json:"entry_path"` ExitPath string `db:"exit_path" json:"exit_path"` PageViews uint16 `db:"page_views" json:"page_views"` IsBounce bool `db:"is_bounce" json:"is_bounce"` EntryTitle string `db:"entry_title" json:"entry_title"` ExitTitle string `db:"exit_title" json:"exit_title"` Language string `json:"language"` CountryCode string `db:"country_code" json:"country_code"` City string `json:"city"` Referrer string `json:"referrer"` ReferrerName string `db:"referrer_name" json:"referrer_name"` ReferrerIcon string `db:"referrer_icon" json:"referrer_icon"` OS string `json:"os"` OSVersion string `db:"os_version" json:"os_version"` Browser string `json:"browser"` BrowserVersion string `db:"browser_version" json:"browser_version"` Desktop bool `json:"desktop"` Mobile bool `json:"mobile"` ScreenClass string `db:"screen_class" json:"screen_class"` UTMSource string `db:"utm_source" json:"utm_source"` UTMMedium string `db:"utm_medium" json:"utm_medium"` UTMCampaign string `db:"utm_campaign" json:"utm_campaign"` UTMContent string `db:"utm_content" json:"utm_content"` UTMTerm string `db:"utm_term" json:"utm_term"` Extended uint16 `json:"extended"` }
Session represents a single visitor.
type TimeSpentStats ¶
type TimeSpentStats struct { Day null.Time `json:"day"` Week null.Time `json:"week"` Month null.Time `json:"month"` Year null.Time `json:"year"` Path string `json:"path"` Title string `json:"title"` AverageTimeSpentSeconds int `db:"average_time_spent_seconds" json:"average_time_spent_seconds"` }
TimeSpentStats is the result type for average time spent statistics (sessions, time on page).
type TotalVisitorSessionStats ¶
TotalVisitorSessionStats are the total amount of visitors, views, and sessions for a page.
type TotalVisitorStats ¶
type TotalVisitorStats struct { Visitors int `json:"visitors"` Views int `json:"views"` Sessions int `json:"sessions"` Bounces int `json:"bounces"` BounceRate float64 `db:"bounce_rate" json:"bounce_rate"` CR float64 `json:"cr"` CustomMetricAvg float64 `db:"custom_metric_avg" json:"custom_metric_avg"` CustomMetricTotal float64 `db:"custom_metric_total" json:"custom_metric_total"` }
TotalVisitorStats is the result type for total visitor statistics.
type TotalVisitorsPageViewsStats ¶
type TotalVisitorsPageViewsStats struct { Visitors int `json:"visitors"` Views int `json:"views"` VisitorsGrowth float64 `json:"visitors_growth"` ViewsGrowth float64 `json:"views_growth"` }
TotalVisitorsPageViewsStats is the result type for total visitor count and number of page views statistics.
type UTMCampaignStats ¶
type UTMCampaignStats struct { MetaStats UTMCampaign string `db:"utm_campaign" json:"utm_campaign"` }
UTMCampaignStats is the result type for utm campaign statistics.
type UTMContentStats ¶
UTMContentStats is the result type for utm content statistics.
type UTMMediumStats ¶
UTMMediumStats is the result type for utm medium statistics.
type UTMSourceStats ¶
UTMSourceStats is the result type for utm source statistics.
type UTMTermStats ¶
UTMTermStats is the result type for utm term statistics.
type UserAgent ¶
type UserAgent struct { // Time is the creation date for the database record. Time time.Time // UserAgent is the full User-Agent for the database record. UserAgent string `db:"user_agent"` // Browser is the browser name. Browser string `db:"-"` // BrowserVersion is the browser (non-technical) version number. BrowserVersion string `db:"-"` // OS is the operating system. OS string `db:"-"` // OSVersion is the operating system version number. OSVersion string `db:"-"` // Mobile indicated whether this is a mobile device from client hint headers. // It'll be set to null if the header is not present or empty. Mobile null.Bool `db:"-"` }
UserAgent contains information extracted from the User-Agent header. The creation time and User-Agent are stored in the database to find bots.
type VisitorHourStats ¶
type VisitorHourStats struct { Hour int `json:"hour"` Visitors int `json:"visitors"` Views int `json:"views"` Sessions int `json:"sessions"` Bounces int `json:"bounces"` BounceRate float64 `db:"bounce_rate" json:"bounce_rate"` CR float64 `json:"cr"` CustomMetricAvg float64 `db:"custom_metric_avg" json:"custom_metric_avg"` CustomMetricTotal float64 `db:"custom_metric_total" json:"custom_metric_total"` }
VisitorHourStats is the result type for visitor statistics grouped by time of day.
type VisitorStats ¶
type VisitorStats struct { Day null.Time `json:"day"` Week null.Time `json:"week"` Month null.Time `json:"month"` Year null.Time `json:"year"` Visitors int `json:"visitors"` Views int `json:"views"` Sessions int `json:"sessions"` Bounces int `json:"bounces"` BounceRate float64 `db:"bounce_rate" json:"bounce_rate"` CR float64 `json:"cr"` CustomMetricAvg float64 `db:"custom_metric_avg" json:"custom_metric_avg"` CustomMetricTotal float64 `db:"custom_metric_total" json:"custom_metric_total"` }
VisitorStats is the result type for visitor statistics.