Skip to content

Commit

Permalink
Merge branch 'dev' into analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecao committed Nov 21, 2024
2 parents 1ff9d69 + 6ed660d commit 8651fe3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/components/metrics/WorldMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export function WorldMap({
const { formatMessage, labels } = useMessages();
const { countryNames } = useCountryNames(locale);
const visitorsLabel = formatMessage(labels.visitors).toLocaleLowerCase(locale);
const unknownLabel = formatMessage(labels.unknown);
const {
dateRange: { startDate, endDate },
} = useDateRange(websiteId);
Expand Down Expand Up @@ -62,7 +63,9 @@ export function WorldMap({
if (code === 'AQ') return;
const country = metrics?.find(({ x }) => x === code);
setTooltipPopup(
`${countryNames[code]}: ${formatLongNumber(country?.y || 0)} ${visitorsLabel}` as any,
`${countryNames[code] || unknownLabel}: ${formatLongNumber(
country?.y || 0,
)} ${visitorsLabel}` as any,
);
};

Expand Down
4 changes: 2 additions & 2 deletions src/tracker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
document,
history,
} = window;
const { hostname, href } = location;
const { hostname, href, origin } = location;
const { currentScript, referrer } = document;
const localStorage = href.startsWith('data:') ? undefined : window.localStorage;

Expand Down Expand Up @@ -260,7 +260,7 @@
}

let currentUrl = parseURL(href);
let currentRef = referrer !== hostname ? referrer : '';
let currentRef = referrer.startsWith(origin) ? '' : referrer;
let title = document.title;
let cache;
let initialized;
Expand Down

0 comments on commit 8651fe3

Please sign in to comment.