Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

fixed country code issue

Blue Mouse8aab85335acd
diff --git a/src/analytics/analytics.service.ts b/src/analytics/analytics.service.ts
index 4f0c09834..be79c0b7e 100644
--- a/src/analytics/analytics.service.ts
+++ b/src/analytics/analytics.service.ts
@@ -190,7 +190,11 @@ export class AnalyticsService {
if (isLocale(lc)) {
// uppercase the locale after '-' char, so for example both 'en-gb' and 'en-GB' in result will be 'en-GB'
const lcParted = _split(lc, '-')
- lcParted[1] = _toUpper(lcParted[1])
+
+ if (_size(lcParted) > 1) {
+ lcParted[1] = _toUpper(lcParted[1])
+ }
+
// @ts-ignore
logDTO.lc = _join(lcParted, '-')
} else {