Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
Adding registered_country fallback to getCountry
effakt6b3eb7617ddb
diff --git a/lib/request.js b/lib/request.jsindex 210921b98..78e0e351b 100644--- a/lib/request.js+++ b/lib/request.js@@ -73,7 +73,8 @@ export async function getCountry(req, ip) {const result = lookup.get(ip);- return result?.country?.iso_code;+ // country can not be set, fallback to registerd_country in this case+ return result?.country?.iso_code ?? result?.registered_country?.iso_code;}export async function getClientInfo(req, { screen }) {