analytics

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// HeapBaseURI is the location of Heap API endpoint
	HeapBaseURI = "https://heapanalytics.com"
	// HeapAppID identifies what Heap App events are recorded against
	HeapAppID = "4248790180" // development id, overridden during `make build`

	// ConsentGiven records whether tracking consent has been given by the user
	ConsentGiven bool
)

Functions

func IsConsentRecorded

func IsConsentRecorded() (rec bool)

IsConsentRecorded returns if valid consent has been recorded for tracking

func LogInvoke

func LogInvoke(ctx *kong.Context)

LogInvoke logs an invocation of the cli

func PromptForConsent

func PromptForConsent(in io.Reader, out io.Writer) (c bool, err error)

PromptForConsent interactively prompts the user for consent

func ReadConsent

func ReadConsent(in io.Reader, out io.Writer) (c bool, err error)

ReadConsent finds if consent has been given, either from file or by prompt.

func Submit

func Submit(e Event) (err error)

Submit submits an analytics event to Section

Behavior is determined by consent:

if consent not given {
	prompt for consent
}
if consent == true {
	submit analytics
}

func WriteConsent

func WriteConsent(consent bool) (err error)

WriteConsent writes the current consent state to a persistent file

Types

type Event

type Event struct {
	Name       string
	Properties map[string]string
}

Event records an interaction with the Section CLI

Jump to

Keyboard shortcuts

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