π 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!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
Display ISP details for session & profile view
Blue Mouse488caf8d94aa
diff --git a/backend/apps/cloud/src/analytics/analytics.service.ts b/backend/apps/cloud/src/analytics/analytics.service.tsindex 08cde15b7..0dc3a863a 100644--- a/backend/apps/cloud/src/analytics/analytics.service.ts+++ b/backend/apps/cloud/src/analytics/analytics.service.ts@@ -7436,7 +7436,7 @@ export class AnalyticsService {const querySessionDetails = `SELECT- dv, br, brv, os, osv, lc, ref, so, me, ca, te, co, cc, rg, ct, profileId+ dv, br, brv, os, osv, lc, ref, so, me, ca, te, co, cc, rg, ct, isp, og, ut, ctp, profileIdFROM eventsWHEREpid = {pid:FixedString(12)}@@ -7575,7 +7575,7 @@ export class AnalyticsService {if (!details) {const querySessionDetailsFromCustomEV = `SELECT- dv, br, brv, os, osv, lc, ref, so, me, ca, te, co, cc, rg, ct, profileId+ dv, br, brv, os, osv, lc, ref, so, me, ca, te, co, cc, rg, ct, isp, og, ut, ctp, profileIdFROM eventsWHEREpid = {pid:FixedString(12)}@@ -8512,7 +8512,11 @@ export class AnalyticsService {any(br) AS br,any(brv) AS brv,any(dv) AS dv,- any(lc) AS lc+ any(lc) AS lc,+ any(isp) AS isp,+ any(og) AS og,+ any(ut) AS ut,+ any(ctp) AS ctpFROM eventsWHERE pid = {pid:FixedString(12)}AND profileId = {profileId:String}diff --git a/backend/apps/cloud/src/demo-data/demo-data.service.ts b/backend/apps/cloud/src/demo-data/demo-data.service.tsindex d171a72c0..64b362708 100644--- a/backend/apps/cloud/src/demo-data/demo-data.service.ts+++ b/backend/apps/cloud/src/demo-data/demo-data.service.ts@@ -51,13 +51,27 @@ interface Weighted<T> {value: T}+// Mirrors the network intelligence traits the IP database returns: `usageType`+// is lowercase snake_case and `connectionType` is title case, which is what+// project.usageTypeMapping / project.connectionTypeMapping expect once the+// frontend has lowercased and underscored them.+interface NetworkProfile {+ isp: string+ organization: string+ usageType: string+ connectionType: string+}+interface Geo {cc: stringcountry: stringregion: stringrgc: stringcity: string- isp: string+ // Sessions get `mobile` when they are generated with a phone client, so the+ // carrier, usage type and connection type stay consistent with the device.+ fixedLine: NetworkProfile+ mobile: NetworkProfilelocale: stringutcOffset: numberweight: number@@ -111,6 +125,7 @@ interface SessionContext {identified: booleanstart: Dayjsgeo: Geo+ network: NetworkProfilesource: TrafficSourceclient: ClientProfilepages: string[]@@ -158,7 +173,18 @@ const GEO_POOL: Geo[] = [region: 'California',rgc: 'CA',city: 'San Francisco',- isp: 'Cloudflare WARP',+ fixedLine: {+ isp: 'Cloudflare WARP',+ organization: 'Cloudflare, Inc.',+ usageType: 'consumer_privacy_network',+ connectionType: 'Corporate',+ },+ mobile: {+ isp: 'T-Mobile USA',+ organization: 'T-Mobile USA, Inc.',+ usageType: 'cellular',+ connectionType: 'Cellular',+ },locale: 'en-US',utcOffset: -7,weight: 18,@@ -169,7 +195,18 @@ const GEO_POOL: Geo[] = [region: 'New York',rgc: 'NY',city: 'New York',- isp: 'Verizon Business',+ fixedLine: {+ isp: 'Verizon Business',+ organization: 'Verizon Communications Inc.',+ usageType: 'business',+ connectionType: 'Corporate',+ },+ mobile: {+ isp: 'Verizon Wireless',+ organization: 'Cellco Partnership d/b/a Verizon Wireless',+ usageType: 'cellular',+ connectionType: 'Cellular',+ },locale: 'en-US',utcOffset: -4,weight: 14,@@ -180,7 +217,18 @@ const GEO_POOL: Geo[] = [region: 'England',rgc: 'ENG',city: 'London',- isp: 'BT',+ fixedLine: {+ isp: 'BT',+ organization: 'British Telecommunications PLC',+ usageType: 'residential',+ connectionType: 'Cable/DSL',+ },+ mobile: {+ isp: 'EE',+ organization: 'EE Limited',+ usageType: 'cellular',+ connectionType: 'Cellular',+ },locale: 'en-GB',utcOffset: 1,weight: 12,@@ -191,7 +239,18 @@ const GEO_POOL: Geo[] = [region: 'Berlin',rgc: 'BE',city: 'Berlin',- isp: 'Deutsche Telekom',+ fixedLine: {+ isp: 'Deutsche Telekom',+ organization: 'Deutsche Telekom AG',+ usageType: 'residential',+ connectionType: 'Cable/DSL',+ },+ mobile: {+ isp: 'Vodafone DE',+ organization: 'Vodafone GmbH',+ usageType: 'cellular',+ connectionType: 'Cellular',+ },locale: 'de-DE',utcOffset: 2,weight: 9,@@ -202,7 +261,18 @@ const GEO_POOL: Geo[] = [region: 'North Holland',rgc: 'NH',city: 'Amsterdam',- isp: 'KPN',+ fixedLine: {+ isp: 'KPN',+ organization: 'KPN B.V.',+ usageType: 'residential',+ connectionType: 'Fiber',+ },+ mobile: {+ isp: 'Odido',+ organization: 'Odido Netherlands B.V.',+ usageType: 'cellular',+ connectionType: 'Cellular',+ },locale: 'nl-NL',utcOffset: 2,weight: 7,@@ -213,7 +283,18 @@ const GEO_POOL: Geo[] = [region: 'Ontario',rgc: 'ON',city: 'Toronto',- isp: 'Rogers',+ fixedLine: {+ isp: 'Rogers',+ organization: 'Rogers Communications Canada Inc.',+ usageType: 'residential',+ connectionType: 'Cable/DSL',+ },+ mobile: {+ isp: 'Bell Mobility',+ organization: 'Bell Mobility Inc.',+ usageType: 'cellular',+ connectionType: 'Cellular',+ },locale: 'en-CA',utcOffset: -4,weight: 7,@@ -224,7 +305,18 @@ const GEO_POOL: Geo[] = [region: 'Ile-de-France',rgc: 'IDF',city: 'Paris',- isp: 'Orange',+ fixedLine: {+ isp: 'Orange',+ organization: 'Orange S.A.',+ usageType: 'residential',+ connectionType: 'Fiber',+ },+ mobile: {+ isp: 'Free Mobile',+ organization: 'Free Mobile SAS',+ usageType: 'cellular',+ connectionType: 'Cellular',+ },locale: 'fr-FR',utcOffset: 2,weight: 6,@@ -235,7 +327,18 @@ const GEO_POOL: Geo[] = [region: 'Karnataka',rgc: 'KA',city: 'Bengaluru',- isp: 'Airtel Broadband',+ fixedLine: {+ isp: 'Airtel Broadband',+ organization: 'Bharti Airtel Limited',+ usageType: 'residential',+ connectionType: 'Cable/DSL',+ },+ mobile: {+ isp: 'Jio',+ organization: 'Reliance Jio Infocomm Limited',+ usageType: 'cellular',+ connectionType: 'Cellular',+ },locale: 'en-IN',utcOffset: 5.5,weight: 6,@@ -246,7 +349,18 @@ const GEO_POOL: Geo[] = [region: 'Tokyo',rgc: '13',city: 'Tokyo',- isp: 'NTT Communications',+ fixedLine: {+ isp: 'NTT Communications',+ organization: 'NTT Communications Corporation',+ usageType: 'business',+ connectionType: 'Corporate',+ },+ mobile: {+ isp: 'NTT Docomo',+ organization: 'NTT Docomo, Inc.',+ usageType: 'cellular',+ connectionType: 'Cellular',+ },locale: 'ja-JP',utcOffset: 9,weight: 5,@@ -257,7 +371,18 @@ const GEO_POOL: Geo[] = [region: 'New South Wales',rgc: 'NSW',city: 'Sydney',- isp: 'Telstra',+ fixedLine: {+ isp: 'Telstra',+ organization: 'Telstra Limited',+ usageType: 'residential',+ connectionType: 'Cable/DSL',+ },+ mobile: {+ isp: 'Telstra Mobile',+ organization: 'Telstra Limited',+ usageType: 'cellular',+ connectionType: 'Cellular',+ },locale: 'en-AU',utcOffset: 10,weight: 4,@@ -268,7 +393,18 @@ const GEO_POOL: Geo[] = [region: 'Sao Paulo',rgc: 'SP',city: 'Sao Paulo',- isp: 'Vivo',+ fixedLine: {+ isp: 'Vivo',+ organization: 'Telefonica Brasil S.A.',+ usageType: 'residential',+ connectionType: 'Fiber',+ },+ mobile: {+ isp: 'Vivo Movel',+ organization: 'Telefonica Brasil S.A.',+ usageType: 'cellular',+ connectionType: 'Cellular',+ },locale: 'pt-BR',utcOffset: -3,weight: 4,@@ -279,7 +415,18 @@ const GEO_POOL: Geo[] = [region: 'Masovian',rgc: '14',city: 'Warsaw',- isp: 'Orange Polska',+ fixedLine: {+ isp: 'Orange Polska',+ organization: 'Orange Polska Spolka Akcyjna',+ usageType: 'residential',+ connectionType: 'Cable/DSL',+ },+ mobile: {+ isp: 'Play',+ organization: 'P4 Sp. z o.o.',+ usageType: 'cellular',+ connectionType: 'Cellular',+ },locale: 'pl-PL',utcOffset: 2,weight: 3,@@ -1419,6 +1566,9 @@ export class DemoDataService implements OnModuleInit {identified,start,geo,+ // Tablets sit in the mobile client pool but are usually on Wi-Fi, so only+ // phones get the carrier profile.+ network: client.dv === 'mobile' ? geo.mobile : geo.fixedLine,source,client,pages: journey.pages,@@ -1712,10 +1862,10 @@ export class DemoDataService implements OnModuleInit {rg: session.geo.region,rgc: session.geo.rgc,ct: session.geo.city,- isp: session.geo.isp,- og: session.source.name,- ut: session.source.me,- ctp: session.source.ca,+ isp: session.network.isp,+ og: session.network.organization,+ ut: session.network.usageType,+ ctp: session.network.connectionType,dns,tls,conn,@@ -1970,7 +2120,10 @@ export class DemoDataService implements OnModuleInit {rg: session.geo.region,rgc: session.geo.rgc,ct: session.geo.city,- isp: session.geo.isp,+ isp: session.network.isp,+ og: session.network.organization,+ ut: session.network.usageType,+ ctp: session.network.connectionType,created: this.format(created),}}@@ -2101,10 +2254,10 @@ export class DemoDataService implements OnModuleInit {rg: session.geo.region,rgc: session.geo.rgc,ct: session.geo.city,- isp: session.geo.isp,- og: session.source.name,- ut: session.source.me,- ctp: session.source.ca,+ isp: session.network.isp,+ og: session.network.organization,+ ut: session.network.usageType,+ ctp: session.network.connectionType,meta: {returning: String(session.returning),identified: String(session.identified),diff --git a/backend/apps/community/src/analytics/analytics.service.ts b/backend/apps/community/src/analytics/analytics.service.tsindex c00dd5dfc..c5540b7f6 100644--- a/backend/apps/community/src/analytics/analytics.service.ts+++ b/backend/apps/community/src/analytics/analytics.service.ts@@ -5928,7 +5928,7 @@ export class AnalyticsService {const querySessionDetails = `SELECT- dv, br, brv, os, osv, lc, ref, so, me, ca, te, co, cc, rg, ct, profileId+ dv, br, brv, os, osv, lc, ref, so, me, ca, te, co, cc, rg, ct, isp, og, ut, ctp, profileIdFROM eventsWHEREpid = {pid:FixedString(12)}@@ -6019,7 +6019,7 @@ export class AnalyticsService {if (!details) {const querySessionDetailsFromCustomEV = `SELECT- dv, br, brv, os, osv, lc, ref, so, me, ca, te, co, cc, rg, ct, profileId+ dv, br, brv, os, osv, lc, ref, so, me, ca, te, co, cc, rg, ct, isp, og, ut, ctp, profileIdFROM eventsWHEREpid = {pid:FixedString(12)}@@ -7341,7 +7341,11 @@ export class AnalyticsService {argMax(br, created) AS br,argMax(brv, created) AS brv,argMax(dv, created) AS dv,- argMax(lc, created) AS lc+ argMax(lc, created) AS lc,+ argMax(isp, created) AS isp,+ argMax(og, created) AS og,+ argMax(ut, created) AS ut,+ argMax(ctp, created) AS ctpFROM eventsWHERE pid = {pid:FixedString(12)}AND profileId = {profileId:String}diff --git a/web/app/lib/models/Project.ts b/web/app/lib/models/Project.tsindex 305e6459a..b5afb9ebe 100644--- a/web/app/lib/models/Project.ts+++ b/web/app/lib/models/Project.ts@@ -126,6 +126,10 @@ export interface SessionDetails {city: string | nulldevice: string | nullprofileId: string | null+ isp: string | null+ organization: string | null+ user_type: string | null+ connection_type: string | nullduration?: numberisLive?: boolean@@ -155,6 +159,10 @@ export interface ProfileDetails extends Profile {locale: string | nullos_version: string | nullbrowser_version: string | null+ isp: string | null+ organization: string | null+ user_type: string | null+ connection_type: string | nulltopPages: { page: string; count: number }[]activityCalendar: { date: string; pageviews: number; events: number }[]totalRevenue?: numberdiff --git a/web/app/pages/Project/tabs/Profiles/ProfileDetails.tsx b/web/app/pages/Project/tabs/Profiles/ProfileDetails.tsxindex 23b0dce53..1232177b3 100644--- a/web/app/pages/Project/tabs/Profiles/ProfileDetails.tsx+++ b/web/app/pages/Project/tabs/Profiles/ProfileDetails.tsx@@ -26,6 +26,10 @@ import { PROJECT_TABS } from '~/lib/constants'import { ProfileDetails as ProfileDetailsType } from '~/lib/models/Project'import { BackButton } from '~/pages/Project/View/components/BackButton'import { useViewProjectContext } from '~/pages/Project/View/ViewProject'+import {+ getUsageTypeLabel,+ getConnectionTypeLabel,+} from '~/pages/Project/View/ViewProject.helpers'import { useCurrentProject } from '~/providers/CurrentProjectProvider'import { useTheme } from '~/providers/ThemeProvider'import Button from '~/ui/Button'@@ -628,6 +632,33 @@ export const ProfileDetails = ({const locationSummary =[countryName, details.region, details.city].filter(Boolean).join(', ') ||t('project.unknown')+ const networkRows: {+ key: string+ label: string+ value: string | null+ valueClassName?: string+ }[] = [+ { key: 'isp', label: t('project.mapping.isp'), value: details.isp },+ { key: 'og', label: t('project.mapping.og'), value: details.organization },+ {+ key: 'ut',+ label: t('project.mapping.ut'),+ value: details.user_type ? getUsageTypeLabel(details.user_type, t) : null,+ // Hosting means the visitor came from a data centre rather than a real+ // consumer connection β a useful hint when triaging suspicious profiles.+ valueClassName:+ details.user_type === 'hosting'+ ? 'text-amber-600 dark:text-amber-500'+ : undefined,+ },+ {+ key: 'ctp',+ label: t('project.mapping.ctp'),+ value: details.connection_type+ ? getConnectionTypeLabel(details.connection_type, t)+ : null,+ },+ ].filter(({ value }) => value)const osTooltipLabel = formatVersionLabel(details.os, details.os_version)const browserTooltipLabel = formatVersionLabel(details.browser,@@ -1009,6 +1040,21 @@ export const ProfileDetails = ({</div></PanelSection>+ {networkRows.length > 0 ? (+ <PanelSection title={t('project.network')}>+ <div>+ {networkRows.map(({ key, label, value, valueClassName }) => (+ <InfoRow+ key={key}+ label={label}+ value={value}+ valueClassName={valueClassName}+ />+ ))}+ </div>+ </PanelSection>+ ) : null}+<PanelSection title={t('project.activityCalendar')}><ActivityCalendar data={details.activityCalendar || []} /></PanelSection>diff --git a/web/app/pages/Project/tabs/Sessions/SessionDetailView.tsx b/web/app/pages/Project/tabs/Sessions/SessionDetailView.tsxindex fa818a0f6..49259769e 100644--- a/web/app/pages/Project/tabs/Sessions/SessionDetailView.tsx+++ b/web/app/pages/Project/tabs/Sessions/SessionDetailView.tsx@@ -26,6 +26,10 @@ import {} from '~/lib/models/Project'import { BackButton } from '~/pages/Project/View/components/BackButton'import { useViewProjectContext } from '~/pages/Project/View/ViewProject'+import {+ getUsageTypeLabel,+ getConnectionTypeLabel,+} from '~/pages/Project/View/ViewProject.helpers'import { useCurrentProject } from '~/providers/CurrentProjectProvider'import { useTheme } from '~/providers/ThemeProvider'import Button from '~/ui/Button'@@ -355,6 +359,33 @@ export const SessionDetailView = ({{ label: t('project.mapping.te'), value: details.utm_term },{ label: t('project.mapping.co'), value: details.utm_content },].filter(({ value }) => value)+ const networkRows: {+ key: string+ label: string+ value: string | null+ valueClassName?: string+ }[] = [+ { key: 'isp', label: t('project.mapping.isp'), value: details.isp },+ { key: 'og', label: t('project.mapping.og'), value: details.organization },+ {+ key: 'ut',+ label: t('project.mapping.ut'),+ value: details.user_type ? getUsageTypeLabel(details.user_type, t) : null,+ // Hosting means the visitor came from a data centre rather than a real+ // consumer connection β a useful hint when triaging suspicious sessions.+ valueClassName:+ details.user_type === 'hosting'+ ? 'text-amber-600 dark:text-amber-500'+ : undefined,+ },+ {+ key: 'ctp',+ label: t('project.mapping.ctp'),+ value: details.connection_type+ ? getConnectionTypeLabel(details.connection_type, t)+ : null,+ },+ ].filter(({ value }) => value)const durationText = details.isLive? sessionOnlineFor || t('dashboard.live'): sessionDuration > 0@@ -740,6 +771,21 @@ export const SessionDetailView = ({</div></PanelSection>+ {networkRows.length > 0 ? (+ <PanelSection title={t('project.network')}>+ <div>+ {networkRows.map(({ key, label, value, valueClassName }) => (+ <InfoRow+ key={key}+ label={label}+ value={value}+ valueClassName={valueClassName}+ />+ ))}+ </div>+ </PanelSection>+ ) : null}+{campaignRows.length > 0 ? (<PanelSection title={t('project.campaigns')}><div>