sdk

package
v1.5.16-0...-543da53 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendEvent

func SendEvent(e IEvent) error

Types

type EventTracking

type EventTracking struct {
	HitType  string `form:"t"`  // Event hit type = event
	Category string `form:"ec"` // Required. Event Category.
	Action   string `form:"ea"` // Required. Event Action.
	Label    string `form:"el"` // Optional. Event label, used as version.
	Value    int    `form:"ev"` // Optional. Event value, must be non-negative integer
}

func (EventTracking) StartTiming

func (e EventTracking) StartTiming(variable string) UserTimingTracking

func (EventTracking) ToUrlValues

func (e EventTracking) ToUrlValues() url.Values

type Exception

type Exception struct {
	HitType     string `form:"t"`   // Hit Type = exception
	Description string `form:"exd"` // exception description. i.e. IOException
	IsFatal     string `form:"exf"` // if the exception was fatal
	// contains filtered or unexported fields
}

func (Exception) ToUrlValues

func (e Exception) ToUrlValues() url.Values

type GAClient

type GAClient struct {
	TrackingID string `form:"tid"` // Tracking ID / Property ID, XX-XXXXXXX-X
	ClientID   string `form:"cid"` // Anonymous Client ID
	Version    string `form:"v"`   // Version
	// contains filtered or unexported fields
}

func NewGAClient

func NewGAClient(trackingID, clientID string) *GAClient

NewGAClient creates a new GAClient object with the trackingID and clientID.

func (*GAClient) SendEvent

func (g *GAClient) SendEvent(e IEvent) error

SendEvent sends one event to Google Analytics

type IEvent

type IEvent interface {
	ToUrlValues() url.Values
}

type UserTimingTracking

type UserTimingTracking struct {
	HitType  string `form:"t"`   // Timing hit type
	Category string `form:"utc"` // Required. user timing category. e.g. jsonLoader
	Variable string `form:"utv"` // Required. timing variable. e.g. load
	Duration string `form:"utt"` // Required. time took duration.
	Label    string `form:"utl"` // Optional. user timing label. e.g jQuery
	// contains filtered or unexported fields
}

func (UserTimingTracking) ToUrlValues

func (e UserTimingTracking) ToUrlValues() url.Values

Jump to

Keyboard shortcuts

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