oopsie
This commit is contained in:
BIN
dist/fitra-darwin-amd64
vendored
BIN
dist/fitra-darwin-amd64
vendored
Binary file not shown.
BIN
dist/fitra-darwin-arm64
vendored
BIN
dist/fitra-darwin-arm64
vendored
Binary file not shown.
BIN
dist/fitra-linux-amd64
vendored
BIN
dist/fitra-linux-amd64
vendored
Binary file not shown.
BIN
dist/fitra-linux-arm64
vendored
BIN
dist/fitra-linux-arm64
vendored
Binary file not shown.
@@ -24,12 +24,17 @@ func SendAnalyticsEvent(eventType, pathname, pageTitle, userAgent, ipAddress str
|
|||||||
return nil // Skip if no API key configured
|
return nil // Skip if no API key configured
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hostname := os.Getenv("BASE_URL")
|
||||||
|
if hostname == "" {
|
||||||
|
hostname = "localhost:8080"
|
||||||
|
}
|
||||||
|
|
||||||
event := AnalyticsEvent{
|
event := AnalyticsEvent{
|
||||||
APIKey: apiKey,
|
APIKey: apiKey,
|
||||||
SiteID: "fitra-backend",
|
SiteID: "fitra-backend",
|
||||||
Type: eventType,
|
Type: eventType,
|
||||||
Pathname: pathname,
|
Pathname: pathname,
|
||||||
Hostname: "a.adhd.sh",
|
Hostname: hostname,
|
||||||
PageTitle: pageTitle,
|
PageTitle: pageTitle,
|
||||||
UserAgent: userAgent,
|
UserAgent: userAgent,
|
||||||
IPAddress: ipAddress,
|
IPAddress: ipAddress,
|
||||||
@@ -40,7 +45,7 @@ func SendAnalyticsEvent(eventType, pathname, pageTitle, userAgent, ipAddress str
|
|||||||
return err
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -50,4 +55,4 @@ func SendAnalyticsEvent(eventType, pathname, pageTitle, userAgent, ipAddress str
|
|||||||
client := &http.Client{}
|
client := &http.Client{}
|
||||||
_, err = client.Do(req)
|
_, err = client.Do(req)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user