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!

fix: session detals are missing locale, UTM, region & city data

Blue Mousee3484ab6ee3b
diff --git a/web/app/api/api.server.ts b/web/app/api/api.server.ts
index 3562d028f..14789e06c 100644
--- a/web/app/api/api.server.ts
+++ b/web/app/api/api.server.ts
@@ -886,8 +886,19 @@ export interface SessionDetailsResponse {
psid: string
cc: string | null
os: string | null
+ osv: string | null
br: string | null
+ brv: string | null
dv: string | null
+ lc: string | null
+ ref: string | null
+ so: string | null
+ me: string | null
+ ca: string | null
+ te: string | null
+ co: string | null
+ rg: string | null
+ ct: string | null
pageviews: number
customEvents: number
errors: number
diff --git a/web/app/pages/Project/tabs/Sessions/SessionDetailView.tsx b/web/app/pages/Project/tabs/Sessions/SessionDetailView.tsx
index 5563d7849..d209ee852 100644
--- a/web/app/pages/Project/tabs/Sessions/SessionDetailView.tsx
+++ b/web/app/pages/Project/tabs/Sessions/SessionDetailView.tsx
@@ -34,7 +34,8 @@ import {
getTimeFromSeconds,
} from '~/utils/generic'
-import CCRow from '../../View/components/CCRow'
+import Flag from '~/ui/Flag'
+import countries from '~/utils/isoCountries'
import NoSessionDetails from './NoSessionDetails'
import { Pageflow } from './Pageflow'
@@ -273,18 +274,31 @@ export const SessionDetailView = ({
label={t('project.mapping.cc')}
value={
details.cc ? (
- <CCRow size={16} cc={details.cc} language={language} />
+ <>
+ <Flag
+ className='rounded-xs'
+ country={details.cc}
+ size={16}
+ alt=''
+ aria-hidden='true'
+ />
+ &nbsp;
+ {[
+ details.rg || details.ct
+ ? details.cc?.toUpperCase()
+ : countries.getName(details.cc, language) ||
+ details.cc,
+ details.rg,
+ details.ct,
+ ]
+ .filter(Boolean)
+ .join(' > ')}
+ </>
) : (
'-'
)
}
/>
- {details.rg ? (
- <InfoRow label={t('project.mapping.rg')} value={details.rg} />
- ) : null}
- {details.ct ? (
- <InfoRow label={t('project.mapping.ct')} value={details.ct} />
- ) : null}
<InfoRow
label={t('project.mapping.lc')}
value={
diff --git a/web/app/pages/Project/tabs/Sessions/SessionsView.tsx b/web/app/pages/Project/tabs/Sessions/SessionsView.tsx
index b838ce6ad..f242c7cf9 100644
--- a/web/app/pages/Project/tabs/Sessions/SessionsView.tsx
+++ b/web/app/pages/Project/tabs/Sessions/SessionsView.tsx
@@ -181,18 +181,18 @@ const SessionsViewInner = ({
const details: SessionDetailsType = {
cc: apiDetails.cc,
os: apiDetails.os,
- osv: null,
+ osv: apiDetails.osv || null,
br: apiDetails.br,
- brv: null,
- lc: null,
- ref: null,
- so: null,
- me: null,
- ca: null,
- te: null,
- co: null,
- rg: null,
- ct: null,
+ brv: apiDetails.brv || null,
+ lc: apiDetails.lc || null,
+ ref: apiDetails.ref || null,
+ so: apiDetails.so || null,
+ me: apiDetails.me || null,
+ ca: apiDetails.ca || null,
+ te: apiDetails.te || null,
+ co: apiDetails.co || null,
+ rg: apiDetails.rg || null,
+ ct: apiDetails.ct || null,
dv: apiDetails.dv,
profileId: apiDetails.profileId,
sdur: apiDetails.sdur,