googleanalytics

package
v1.3.165 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIManager

type APIManager struct {
	Providers        map[string]IProvider
	ProvidersByIndex map[int]IProvider
}

func (*APIManager) GetProvider

func (a *APIManager) GetProvider(name Provider) IProvider

type GoogleAnalytics4

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

GoogleAnalytics4 https://developers.google.com/analytics/devguides/reporting/data/v1

func (*GoogleAnalytics4) GetDimensionsAndMetrics added in v1.1.41

func (g *GoogleAnalytics4) GetDimensionsAndMetrics(ctx context.Context) ([]*ga.DimensionMetadata, []*ga.MetricMetadata, error)

func (*GoogleAnalytics4) GetMetrics added in v1.1.60

func (g *GoogleAnalytics4) GetMetrics(
	ctx context.Context,
	dateFrom string,
	dateTo string,
	metrics []string,
	dimensions []string,
) (map[uint64]map[string]interface{}, error)

func (*GoogleAnalytics4) GetName

func (g *GoogleAnalytics4) GetName() Provider

func (*GoogleAnalytics4) RunReport

func (g *GoogleAnalytics4) RunReport(ctx context.Context, runReportRequest *ga.RunReportRequest) (*ga.RunReportResponse, error)

type IAPIManager

type IAPIManager interface {
	GetProvider(name Provider) IProvider
}

func NewAPIManager

func NewAPIManager(
	localConfigFolder string,
	configService config.IConfig,
	errorLogger errorlogger.ErrorLogger,
	newProviderFunctions ...NewProviderFunc,
) (IAPIManager, error)

type IProvider

type IProvider interface {
	GetName() Provider
	RunReport(ctx context.Context, runReportRequest *ga.RunReportRequest) (*ga.RunReportResponse, error)
	GetDimensionsAndMetrics(ctx context.Context) ([]*ga.DimensionMetadata, []*ga.MetricMetadata, error)
	GetMetrics(ctx context.Context, dateFrom, dateTo string, metrics []string, dimensions []string) (map[uint64]map[string]interface{}, error)
}

func NewGA4

func NewGA4(configFolder string, configService config.IConfig, errorlogger errorlogger.ErrorLogger) (IProvider, error)

type NewProviderFunc

type NewProviderFunc func(configFolder string, configService config.IConfig, errorLogger errorlogger.ErrorLogger) (IProvider, error)

type Provider

type Provider string
const (
	UA  Provider = "ua" // TODO: Implement later
	GA4 Provider = "ga4"
)

func (Provider) String

func (p Provider) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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