analytics

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Event

func Event(r *http.Request, name string, duration int, meta, tags map[string]string)

Event sends a custom event using the configured Analytics provider.

func Init

func Init()

Init initializes the analytics client if configured.

func PageView

func PageView(r *http.Request, tags map[string]string)

PageView sends a page view using the configured Analytics provider.

Types

type Analytics

type Analytics interface {
	// PageView sends a page view for given request and optional tags.
	PageView(*http.Request, map[string]string) error

	// Event sends a custom event for given request, name, duration, meta data, and optional tags.
	Event(*http.Request, string, int, map[string]string, map[string]string) error
}

Analytics is the interface for an analytics provider.

type PirschAnalytics

type PirschAnalytics struct {
	// contains filtered or unexported fields
}

PirschAnalytics is the analytics provider for Pirsch (pirsch.io).

func NewPirschAnalytics

func NewPirschAnalytics(clientID, clientSecret string) *PirschAnalytics

NewPirschAnalytics creates a new Analytics provider for Pirsch.

func (*PirschAnalytics) Event

func (provider *PirschAnalytics) Event(r *http.Request, name string, duration int, meta, tags map[string]string) error

Event implements the Analytics interface.

func (*PirschAnalytics) PageView

func (provider *PirschAnalytics) PageView(r *http.Request, tags map[string]string) error

PageView implements the Analytics interface.

Jump to

Keyboard shortcuts

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