Documentation
¶
Overview ¶
Package analytics provides Google Analytics 4 (GA4) Measurement Protocol integration for server-side event tracking from the Vulnetix CLI.
This uses the same GA4 property (G-NWBJE5RS0Q) as the Vulnetix website, enabling unified analytics across the web app and CLI.
Privacy: All tracking is anonymous. No PII is collected. Users can opt out by setting VULNETIX_NO_ANALYTICS=1 or DO_NOT_TRACK=1.
Index ¶
- Constants
- func Init(version, platform string)
- func TrackAuth(method, action string, success bool)
- func TrackCommand(command string, args map[string]interface{})
- func TrackError(command, errorMsg string, fatal bool)
- func TrackEvent(eventName string, params map[string]interface{})
- func TrackScan(scanType string, fileCount int)
- func TrackVDBQuery(subcommand, apiVersion string)
- type Client
Constants ¶
const ( CategoryCommand = "cli_command" CategoryAuth = "authentication" CategoryVDB = "vulnerability_database" CategoryScan = "scanning" CategoryError = "error" CategoryEngagement = "engagement" )
Event categories matching the website's ga4-client.ts patterns
Variables ¶
This section is empty.
Functions ¶
func Init ¶
func Init(version, platform string)
Init initializes the global analytics client. Call once at startup. version is the CLI version string. platform is the detected runtime platform.
func TrackCommand ¶
TrackCommand tracks a CLI command invocation.
func TrackError ¶
TrackError tracks an error occurrence.
func TrackEvent ¶
TrackEvent tracks a generic custom event.
func TrackVDBQuery ¶
func TrackVDBQuery(subcommand, apiVersion string)
TrackVDBQuery tracks a VDB API query.