This commit is contained in:
2025-08-17 00:54:27 +02:00
parent d72a9a2686
commit 46bace937f
5 changed files with 8 additions and 3 deletions

Binary file not shown.

Binary file not shown.

BIN
dist/fitra-linux-amd64 vendored

Binary file not shown.

BIN
dist/fitra-linux-arm64 vendored

Binary file not shown.

View File

@@ -24,12 +24,17 @@ func SendAnalyticsEvent(eventType, pathname, pageTitle, userAgent, ipAddress str
return nil // Skip if no API key configured
}
hostname := os.Getenv("BASE_URL")
if hostname == "" {
hostname = "localhost:8080"
}
event := AnalyticsEvent{
APIKey: apiKey,
SiteID: "fitra-backend",
Type: eventType,
Pathname: pathname,
Hostname: "a.adhd.sh",
Hostname: hostname,
PageTitle: pageTitle,
UserAgent: userAgent,
IPAddress: ipAddress,
@@ -40,7 +45,7 @@ func SendAnalyticsEvent(eventType, pathname, pageTitle, userAgent, ipAddress str
return err
}
req, err := http.NewRequest("POST", "https://app.rybbit.io/api/track", bytes.NewBuffer(jsonData))
req, err := http.NewRequest("POST", "https://a.adhd.sh/api/track", bytes.NewBuffer(jsonData))
if err != nil {
return err
}
@@ -50,4 +55,4 @@ func SendAnalyticsEvent(eventType, pathname, pageTitle, userAgent, ipAddress str
client := &http.Client{}
_, err = client.Do(req)
return err
}
}