diff --git a/telemetry.go b/telemetry.go index beca88f..77d9975 100644 --- a/telemetry.go +++ b/telemetry.go @@ -85,15 +85,27 @@ func (a *App) sendTelemetryHeartbeat() { return // already counted today } + // distinct_id identifies the USER. Prefer the station callsign — it's stable + // across every machine/reinstall the same operator runs, so one op counts as + // one user (a callsign is public in amateur radio). The random per-install ID + // is only a fallback until a callsign is configured; without it the same op on + // a laptop + desktop + Maestro showed up as three "users". install_id rides + // along as a property so multiple machines under one callsign stay visible. + installID := a.telemetryInstallID() + distinctID := installID + if call := a.activeCallsign(); call != "" { + distinctID = call + } payload := map[string]any{ "api_key": posthogAPIKey, "event": "app_opened", - "distinct_id": a.telemetryInstallID(), + "distinct_id": distinctID, "properties": map[string]any{ - "version": appVersion, - "os": runtime.GOOS, - "arch": runtime.GOARCH, - "$lib": "opslog", + "version": appVersion, + "os": runtime.GOOS, + "arch": runtime.GOARCH, + "install_id": installID, + "$lib": "opslog", }, "timestamp": time.Now().UTC().Format(time.RFC3339), }