model

package
v6.8.4 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

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 BrowserStats

type BrowserStats struct {
	MetaStats
	Browser string `json:"browser"`
}

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

type CountryStats struct {
	MetaStats
	CountryCode string `db:"country_code" json:"country_code"`
}

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).

func (Event) String

func (event Event) String() string

String implements the Stringer interface.

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.

func (ExitStats) GetPath

func (stats ExitStats) GetPath() string

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

type LanguageStats struct {
	MetaStats
	Language string `json:"language"`
}

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 OSStats

type OSStats struct {
	MetaStats
	OS string `json:"os"`
}

OSStats is the result type for operating system statistics.

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.

func (PageStats) GetPath

func (stats PageStats) GetPath() string

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"`
	TagKeys         []string  `db:"tag_keys" json:"tag_keys"`
	TagValues       []string  `db:"tag_values" json:"tag_values"`
}

PageView represents a single page visit.

func (PageView) String

func (pageView PageView) String() string

String implements the Stringer interface.

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 Request added in v6.7.0

type Request struct {
	ClientID    uint64    `db:"client_id" json:"client_id"`
	VisitorID   uint64    `db:"visitor_id" json:"visitor_id"`
	Time        time.Time `json:"time"`
	IP          string    `json:"ip"`
	UserAgent   string    `db:"user_agent" json:"user_agent"`
	Path        string    `json:"path"`
	Event       string    `db:"event_name" json:"event_name"`
	Referrer    string    `json:"referrer"`
	UTMSource   string    `db:"utm_source" json:"utm_source"`
	UTMMedium   string    `db:"utm_medium" json:"utm_medium"`
	UTMCampaign string    `db:"utm_campaign" json:"utm_campaign"`
	Bot         bool      `json:"bot"`
}

Request represents a request that has or has not been flagged as a bot. The creation time, User-Agent, path, and event name are stored in the database to find bots.

func (Request) String added in v6.7.0

func (request Request) String() string

String implements the Stringer interface.

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.

func (Session) String

func (session Session) String() string

String implements the Stringer interface.

type SessionStep added in v6.8.0

type SessionStep struct {
	PageView *PageView `json:"page_view"`
	Event    *Event    `json:"event"`
}

SessionStep is the result type combining page views and events for a single session.

type TagStats added in v6.7.0

type TagStats struct {
	Key              string  `json:"key"`
	Value            string  `json:"value"`
	Visitors         int     `json:"visitors"`
	Views            int     `json:"views"`
	RelativeVisitors float64 `db:"relative_visitors" json:"relative_visitors"`
	RelativeViews    float64 `db:"relative_views" json:"relative_views"`
}

TagStats is the result type for tags.

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"`
	Minute                  null.Time `json:"minute"`
	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

type TotalVisitorSessionStats struct {
	Path     string
	Visitors int
	Views    int
	Sessions int
}

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

type UTMContentStats struct {
	MetaStats
	UTMContent string `db:"utm_content" json:"utm_content"`
}

UTMContentStats is the result type for utm content statistics.

type UTMMediumStats

type UTMMediumStats struct {
	MetaStats
	UTMMedium string `db:"utm_medium" json:"utm_medium"`
}

UTMMediumStats is the result type for utm medium statistics.

type UTMSourceStats

type UTMSourceStats struct {
	MetaStats
	UTMSource string `db:"utm_source" json:"utm_source"`
}

UTMSourceStats is the result type for utm source statistics.

type UTMTermStats

type UTMTermStats struct {
	MetaStats
	UTMTerm string `db:"utm_term" json:"utm_term"`
}

UTMTermStats is the result type for utm term statistics.

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 VisitorMinuteStats added in v6.8.0

type VisitorMinuteStats struct {
	Minute            int     `json:"minute"`
	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"`
}

VisitorMinuteStats is the result type for visitor statistics grouped by the minute of the hour.

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"`
	Minute            null.Time `json:"minute"`
	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.

Jump to

Keyboard shortcuts

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