mirror of
https://github.com/Kugelschieber/marvinblum.git
synced 2026-01-18 06:40:27 +00:00
Updated pirsch and added country statistics to tracking page.
This commit is contained in:
@@ -138,6 +138,21 @@ func GetBrowser(startDate, endDate time.Time) []pirsch.BrowserStats {
|
||||
return browser
|
||||
}
|
||||
|
||||
func GetCountry(startDate, endDate time.Time) []pirsch.CountryStats {
|
||||
countries, err := analyzer.Country(&pirsch.Filter{From: startDate, To: endDate})
|
||||
|
||||
if err != nil {
|
||||
logbuch.Error("Error reading country statistics", logbuch.Fields{"err": err})
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := range countries {
|
||||
countries[i].CountryCode.String = strings.ToUpper(countries[i].CountryCode.String)
|
||||
}
|
||||
|
||||
return countries
|
||||
}
|
||||
|
||||
func GetPlatform(startDate, endDate time.Time) *pirsch.VisitorStats {
|
||||
return analyzer.Platform(&pirsch.Filter{From: startDate, To: endDate})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user